Description
While using a form based login with a security constraint in web.xml and killing the session on page start the value of 'WebSession.get().getId()' is not equal to '((ServletWebRequest) RequestCycle.get().getRequest()).getHttpServletRequest().getSession(false).getId()'.
This is due to Tomcat's session fixation protection in Tomat 7.0.
We implemented the following workaround:
new HttpSessionStore() {
public Session lookup(Request request) {
String sessionId = getSessionId(request, false);
LOG.debug("AbstractHttpSessionStore#lookup() [sessionId={}]", sessionId);
if (sessionId != null) {
WebRequest webRequest = toWebRequest(request);
Session session = (Session)getAttribute(webRequest, Session.SESSION_ATTRIBUTE_NAME);
// it cannot be okay if the session id's are not equal!!!
if (null != session && !sessionId.equals(session.getId())) {
try
catch (Exception e)
{ throw new IllegalStateException(e); } }
return session;
}
return null;
}
}
Attachments
Attachments
Issue Links
- is related to
-
WICKET-5103 Wicket session id not up to date when container changes session id
- Resolved