|
In our project we’re storing information about the
user in the AuthenticationContext. So far this information has been written on
disk with every request processed by the server, however this is not very good
performance-wise and leads to some problems due to concurrent access. Instead
it would be great if the information stored in the Context could be written
back to disk when the user logs out OR the session times out. Thus it is not sufficient
to add the method to the logout matcher, but to do this using a
HTTPSessionListener which I added to Cocoon’s web.xml. In the method public void sessionDestroyed(HttpSessionEvent
event) I can retrieve the user’s HTTPSession and via this the
ServletContext, but how can I access the AuthenticationContext? Is it
accessable at all? I tought one of these should work, but both are null.
AuthenticationContext authContext =
(AuthenticationContext)session.getServletContext().getContext("authentication");
AuthenticationContext authContext2 =
(AuthenticationContext)session.getServletContext().getContext(AuthenticationConstants.SESSION_CONTEXT_NAME) Cheers, Stefan |
- How to access the AuthenticationContext in a SessionLis... Stefan Pietschmann
- Re: How to access the AuthenticationContext in a S... Stefan Pietschmann
