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
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.
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
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
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.
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
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 ]
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
Post by:autobot
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