Hi, I have a problem:
In my application I'm using HttpSessionListener to manage sessions.
Here is the class:

package com.sergiyarendar.listeners;

import java.util.logging.Logger;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import com.sergiyarendar.services.CounterService;

public class SessionListener implements HttpSessionListener{
        private static final Logger log =
Logger.getLogger(SessionListener.class.getName());
        private static int sessionNumber;
        public void sessionCreated(HttpSessionEvent se){
                log.info("Session Created");
                sessionNumber = CounterService.getSessionNumber();
                sessionNumber++;
                CounterService.setSessionNumber(sessionNumber);
    }
        public void sessionDestroyed(HttpSessionEvent se){
                log.info("Session Destroyed");
                sessionNumber = CounterService.getSessionNumber();
                sessionNumber--;
                CounterService.setSessionNumber(sessionNumber);
        }
}

This is what I have in web.xml file:

<listener>
        <listener-class>com.sergiyarendar.listeners.SessionListener</listener-
class>
</listener>

The problem is that public void sessionCreated(HttpSessionEvent se)
method is invoked if a new session is created, BUT public void
sessionDestroyed(HttpSessionEvent se) method is never invoked. I'm
setting the timeout for the sessions using setMaxInactiveInterval(120)
method when the session begin.

Can anyone say me what is the problem? Is it a GAE bug, or some thing
is wrong with my code? Please, it is very important, becouse whithout
sessionDestroyed() method I can't do any tasks of session management
when the session is destroyed.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to