You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/04/02 10:56:46 UTC

[Bug 56339] New: session listener invalidate session

https://issues.apache.org/bugzilla/show_bug.cgi?id=56339

            Bug ID: 56339
           Summary: session listener invalidate session
           Product: Tomcat 7
           Version: 7.0.47
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Servlet & JSP API
          Assignee: dev@tomcat.apache.org
          Reporter: sivrisoner@yahoo.com

we have sessionlistener
in sessionDestroyed method we call session.invalidate()
in version 7.0.42 its ok but newer versions loops code

public void sessionDestroyed(HttpSessionEvent arg0) {
        if(arg0 !=null && arg0.getSession() !=null)
        {
            HttpSession session = arg0.getSession();
            String sessionId = session.getId();
            if(sessionId != null)
            {
                UserPrincipal userPrincipal =
(UserPrincipal)session.getAttribute(ContextVar.USERPRINCIPLE);
                if (userPrincipal != null)
                {
                    UserOpBLO userOpBLO = new UserOpBLO(new ResourcePool());
                    userOpBLO.processLogoutActivity(sessionId,
userPrincipal.getUserId());
                    CurrentSessions.SESSIONS.remove(sessionId);
                    session.invalidate();
                }
            }
        }
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56339] session listener invalidate session

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56339

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
There should be no need to call session.invalidate() from the session destroyed
event. However, entering an infinite loop if application code does do this is
far from ideal.

This is a side-effect of the fix for bug 55521. I'll look into a fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56339] session listener invalidate session

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56339

Soner Sivri <si...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Soner Sivri <si...@yahoo.com> ---
The code is old code 
My Friend who wrote the code said there was A problem why he put it. He did not
remember the problem.
I understood that you said remove session.invalidate()

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56339] session listener invalidate session

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56339

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
This has been fixed in 8.0.x for 8.0.6 onwards and in 7.0.x 7.0.54 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56339] session listener invalidate session

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56339

--- Comment #1 from Christopher Schultz <ch...@christopherschultz.net> ---
Why would you call session.invalidate() from SessionListener.sessionDestroyed?
It's already in the process of being invalidated.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org