| Author |
Session
|
p hasini
Ranch Hand
Joined: Oct 24, 2009
Posts: 92
|
|
If we close the browser,when the specific user session is
active.Again if we open browse how to retrive it same
user.
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
If you want the user's session to remain active on the server, then set the maxInactiveInterval of the session to a high value and set the age of the JSESSIONID cookie to a high value (default age of JSESSIONID cookie is -1 i.e. till the browser is closed). But this might create a load on the server memory.
If you don't want to waste the memory of your server, then you can let the user's session die after a specific interval of time. Create a custom cookie on the client side to identify the client next time automatically and then create a new session for the client. This is how most sites allow user's session to be active for weeks...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: Session
|
|
|