WebAppConfiguration ownerContext = hostConfig.getWebAppByURI(prefix);
if (ownerContext != null) {
WinstoneSession session = ownerContext.getSessionById(sessionId, true);
if ((session != null) && session.isNew()) {
session.setIsNew(false);
Cookie cookie = new Cookie(WinstoneSession.SESSION_COOKIE_NAME, session.getId());
cookie.setMaxAge(-1);
cookie.setSecure(req.isSecure());
cookie.setVersion(0); //req.isSecure() ? 1 : 0);
cookie.setPath(req.getWebAppConfig().getContextPath().equals("") ? "/"
: req.getWebAppConfig().getContextPath());
this.cookies.add(cookie); // don't call addCookie because we might be including
}
}
}
// Look for expired sessions: ie ones where the requested and current ids are different
for (Iterator i = req.getRequestedSessionIds().keySet().iterator(); i.hasNext(); ) {
String prefix = (String) i.next();
String sessionId = (String) req.getRequestedSessionIds().get(prefix);
if (!req.getCurrentSessionIds().containsKey(prefix)) {
Cookie cookie = new Cookie(WinstoneSession.SESSION_COOKIE_NAME, sessionId);
cookie.setMaxAge(0); // explicitly expire this cookie
cookie.setSecure(req.isSecure());
cookie.setVersion(0); //req.isSecure() ? 1 : 0);
cookie.setPath(prefix.equals("") ? "/" : prefix);
this.cookies.add(cookie); // don't call addCookie because we might be including
}
}
Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WinstoneResponse.HeadersPreCommit",