On 1/18/08, Andrés Robinet <[EMAIL PROTECTED]> wrote: > Please, don't get me wrong, I'm just curious, how does the server know when > the browser is closed? Do you use javascript (AJAX) or something to notify > the server?
it's a browser thing, not a server thing. the browser will "forget" the session cookie when it's closed. the server doesn't care either way. afaik... which sucks, because i do my own session gc based on the last accessed time of the session row in the database*. if the session is removed before the browser is closed, a new one will be started as far as i know; even if the browser thinks it should still have the first normal "session cookie" it will be given a new one. so i typically rely on sessions "only so much" * i use my own mysql-based session handler since i am using multiple webservers