View Single Post
  #1 (permalink)  
Old 06-28-2007, 04:30 AM
bbq bbq is offline
Senior Member
 
Join Date: Jun 2007
Posts: 134
bbq is on a distinguished road
Using HttpSessionListener
I'm developing with an HttpSessionListener

My code is:
Code:
public class SessionListener implements HttpSessionListener, IHttpConstants { public void sessionCreated(HttpSessionEvent event) { HttpSession session = event.getSession(); _log.info("Session [" + session.getId() + "] has been created."); } public void sessionDestroyed(HttpSessionEvent event) { HttpSession session = event.getSession(); _log.info("Session [" + session.getId() + "] is about to be destroyed."); User user = (User) session.getAttribute(SESSION_ATTRIBUTE_USER); if (user != null) { _userTracker.logOut(user); } } private UserTracker _userTracker = UserTracker.getInstance(); private static Category _log = Category.getInstance("log"); }
When the sessionDestroyed method is called a nexception appears : java.lang.IllegalStateException: getAttribute: Session already invalidated is thrown at the line where the user is retrieved from the session.

what is the problem?
Reply With Quote
Sponsored Links