5 Replies Latest reply on Feb 27, 2010 12:06 PM by zabin7

    Sticky sessions

    nickarls

      How come I can't seem to be able to get fresh sessions?


      No matter if I launch fresh Chrome or IE standalone browsers with separate processes I end up with the same HTTP session ID as outputted by ServletContexts.instance().getRequest().getSession().getId()


      Has it always been like this for browsers? I recall at least IE giving fresh ID:s with new browsers. It is an issue because the user would like to log in with different credentials in different browsers but with our current setup the second browser just detects oh, you're already logged in. Even past the login part shared session would be a problem :-/

        • 1. Re: Sticky sessions
          nickarls

          Has anyone tried modifying seam to salt the session id and actually gotten security/contexts working with it?

          • 2. Re: Sticky sessions
            jeanluc

            Something is very fishy there. Have you verified the processes are actually separate? It is quite unlikely the web app server gives an existing session id to a new browser which didn't send the cookie.


            Monitor the traffic. Is the sessionid that you get the same one as the one sent by the browser or is it a new one altogether?

            • 4. Re: Sticky sessions
              nickarls

              Yep, cookies are shared. You have to use various tricks (incognito mode, startup parameters or menu actions) depending on the browser.

              • 5. Re: Sticky sessions
                zabin7

                I think what I am facing is the quite a similar problem.  In the application when the first request is going a session is getting created.  But when a different request is going to the server it is using the same session which is messing up everything.  I mean the business logic is executed for the latest request and when the old request's page is clicked once again it is showing the output for the latest request. I want to mention the action class where the business logic is written is of scope Conversation.


                However if I use different browser, say Firefox for 1st request and IE for 2nd request then it working fine. 


                I tried deleting the cookies :


                Cookie[] cookies = request.getCookies();
                          for(Cookie c : cookies){
                               System.out.println("deleting cookies");
                               c.setMaxAge(0);
                               response.addCookie(c);
                          }



                this also is not working.


                Can anybody give some idea about how to manage this.