On 10/3/07, Eugene Van den Bulke <eugene.vandenbulke gmail.com> wrote:
> I have a small web app based on CP3.0.2 which contains
an exposed
> logout method which clears the session. I would also
like the closure
> of the browser to kill the session but I am not sure
how to go about
> that? Could someone help?
There is no way for the server to reliably perform some
action on
browser close. You can install javascript handlers on pages
that fire
when the user leaves a page, but you have no guarantee that
any
information about it makes it way back to the server.
Invalidating the session on browser close is done by setting
a cookie
that does not persist between browser sessions. I'm not sure
if the
default Session tool does so though, but shouldn't be to
hard to
change if it doesn't. This is passive in the sense that the
server
doesn't know when the browser is closed, but at least the
next browser
session will create a new CP session.
If you need to do cleanup, like closing files, freeing
memory, etc. on
session close, you need to do that with timeouts.
Arnar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|