Nick's Tech Blog: No HttpSession currently exists

Pages

Thursday, June 9, 2011

No HttpSession currently exists

Problem

I was unable to log into the web application, despite correct login details. Received a "No HttpSession currently exists" message in the web filters, despite successful SessionContext creation (previously in the logs).

e.g.
SecurityContextHolder now cleared, as request processing completed
An Authentication object was not found in the SecurityContext


Solution

It appeared as though Websphere7 wasn't saving the session (or anything in it).

By setting a custom session id in the cookies, and by giving the cookies a context path, I was able to get the sessions working (with an app restart).

See: WebSphere Application Server V7: Session Management - http://www.redbooks.ibm.com/redpapers/pdfs/redp4580.pdf

No comments:

Post a Comment