How do you create a new session? Using request.getSession(true) ? This statement supposed to return the ols session if one exists already. Are you using oldSession.invalidate() before creating a new session to clear off the old session? If you want to see if an old one exists, write request.getSession(false) and see if it is not null. If use of "false" arg returns some session obj, (not null), then grab those session values associated with oldSession.
but since he si "accidently" creating a new session object, doesnt he lose his reference to the old one ? IMHO, the old session object will be ripely waiting for gc.
Joined: Jan 31, 2000
That's what I am not clear about. How one can accidently create a new session. We can create a new session with request.getSession(true) right? According to API it should return the old one if there was one already existing. To make sure to make the old one gcd and create a new one, we have to purposly invalidate the old session if one exists and then user request.getSession(true); I didn't rely/check on this "true argument returning the old session if one exists -concept". I just use (true) in only one place where I want to create a new session, an din all other places use (false) argument. Even in the place where I use (true), I first check with "false" argument, if it is null , go for "true" arg. Otherwise, invalidate the old one and use "true" aru to create a fresh one. regds maha anna [This message has been edited by maha anna (edited April 27, 2001).]
Joined: Jan 06, 2001
Thanks for the atention, well I think i solve the problem, in fact i didn�t have time to test the program yet, cause here in Brazil it�s already 6pm and I have to go to University. About a new session I believe that a new one was being created cause I had some global variables, I�ve changed the code but like I said I didn�t have the time to test yet, I hope it was just this. Anyway thank�s a lot. JavaRanch is the coolest place in internet.
subject: How to recover values from an old session???(Is it possible??)