I have an application which has many popups . But i am encountering a weird scenario while working with this
I logged in to my system (which uses a HttpSession) and then i opened a popup . I submitted the data in the popup and operation in the popup is expected to take some time . In the mean while i logged out(the HttpSession is invalidated on logout) the user in the parent window and logged in again with the same user name.
After the user has logged in again, by this time operation in popup is complete which is supposed to return some response in the popup but now session expired message comes up(as i have used some tag similar to check logon which checks the user data in session and takes him to the page if the session doesn't contain any data) which is fine
But to the surprise , clicking in the parent window also shows the same session expired (i hadn't done any logout ....)
After lot of analysis i found that as soon as i logout for the first time , tomcat is creating a new session which is assigned to the popup window and the same is getting applied to the parent window also even though a seperate HttpSession was created for this window ........now after this request.getSession() in the parent window is giving me the newly created session in the popup which doesn't have any user data
It sounds like you just shouldn't be logging out while trying to do something. If I understand correctly, you said that your popup is waiting for something from the server, but then you're invalidating the session that the server is using and then expecting that session to be there...why how could you invalidate the session being used and then expect to still be able to use it after it's destroyed?
Joined: Sep 21, 2003
Yah u got it correctly . May be i should not log out if the user is performing some operation but how can i get to know this while invalidating ??
U understood my problem clearly , i am invalidating (logging out) the session when its in use ....and its obvious that tomcat will create immediately new session after the one is invalidated for that browser
but one thing which surprises me is , when i logout the first user and login again ....at the point when login is successful , i observed the session object let say A . Later after that popup operation is over and when it comes back the session in the pop up is replacing the parent windows.i mean calling request.getSession() in the parent window is giving another session object B rather its expected to give A as the session .......
Hope u got the problem ..i think it has something to do with session mechanism of tomcat
sreenath, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.
I do agree that popup should take the same session space as the opener but when i logged out parent window ie nothing but invalidating the existing session , and logged in again a new HttpSession objevt is created but at this moment the popup is not having the same newly created session object (which the parent window has)