Forums Register Login

how does the server expire the session

+Pie Number of slices to send: Send
Can any one tell me When a client request an jsp site from the server
The server will generate a seperate session Id for each client.
this is general
My question is How does the server detect that the client has closed the
explorer to expire the session ?
sangeetha
+Pie Number of slices to send: Send
the server doesn't.
It maintains a list of active sessions with a timestamp when the last access was.
Whenever a request is made the entry for that session is updated with a fresh timestamp (or a new entry made if it's a new session).
At regular intervals this list is polled to see which sessions haven't been accessed in the set timeout period, and those sessions are killed.
How this is implemented will of course differ between server implementations.
+Pie Number of slices to send: Send
Hi..
The session also resides in the user system as a Cookie & on the server & they are name-value pairs..as soon as the user closes the explorer..the cookie is lost & the container removes the session.
This all stuff is handled by the container..
hth
MB
+Pie Number of slices to send: Send
Session can be invalidated by two methods. First is the server finds the last accessed time of the session(time stamp) and the current time , and finds the difference, and matches with the session time out parameter configured in webserver configuration file, or the explicitly set value for that particular session.
Second one is user can invalidate their session by invoking invalidate() method on the session object by the user.
regards,
Ganapathy,S
+Pie Number of slices to send: Send
 

Originally posted by Malhar Barai:
Hi..
The session also resides in the user system as a Cookie & on the server & they are name-value pairs..as soon as the user closes the explorer..the cookie is lost & the container removes the session.
This all stuff is handled by the container..
hth
MB


You're quite wrong there...
You will have to tell the server explicitly that you're closing the browser or it will never know until the session timeout occurs.
There is no "magic" by which the browser tells the server it is closing unless you specifically code an onunload event into your HTML that does a final request telling the server what's going on.
+Pie Number of slices to send: Send
Hi,
If the session is stored in cookie.Does the user browser save that cookie
in the client side ???

Regards,
Sangeetha
+Pie Number of slices to send: Send
 

Originally posted by Jeroen Wenting:

You're quite wrong there...
You will have to tell the server explicitly that you're closing the browser or it will never know until the session timeout occurs.
There is no "magic" by which the browser tells the server it is closing unless you specifically code an onunload event into your HTML that does a final request telling the server what's going on.


Hi Jeroen...
Maybe I would agree to you on this...
But I had read it somewhere, & I am trying to get the source of it...else how would the container know when the browser has closed, if you hv noted that the session is lost on closing the browser..
Will get back to you as soon as I get the source...
& Sangeetha, the session is indeed refrenced by a cookie that resides on the client-side..
MB
+Pie Number of slices to send: Send
Hi...
Check out this Thread
hth
MB
+Pie Number of slices to send: Send
When the browser is closed there is no way the server will come to know about it. It is only when the session times out the session dies.
+Pie Number of slices to send: Send
 


It may also be worth noting that session cookies are typically resident in memory only and disappear when the browser is closed, but they don't have to be


from this thread
still I m looking fr something to suffice my statement, & I dont say that I'm cent percent right..
Hope you all agree that the session is lost when browser is closed...how does this happen then...??
MB
[ November 28, 2003: Message edited by: Malhar Barai ]
+Pie Number of slices to send: Send
 

Hope you all agree that the session is lost when browser is closed...how does this happen then...??


The cookie is lost when the browser is closed.
+Pie Number of slices to send: Send
oops...
I got it wrong...indeed the cookie is lost...thats what I stated in my first post..


as soon as the user closes the explorer(browser)..the cookie is lost


I lose my 0.02 cents...
MB
+Pie Number of slices to send: Send
 

& the container removes the session


This is what you got it wrong in the first post.
+Pie Number of slices to send: Send
yup..agreed..
The container doesnt remove the session...but it gets expired after some time that is specified, & they are maintained in Hashtable...
So..am I right now..
MB
The only cure for that is hours of television radiation. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1508 times.
Similar Threads
Getting NullPointerException while counting number of visitors using session
Trap window close event for IE browser
if browser is closed,does session expire?
session timeout
sessions
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:42:30.