List Info

Thread: killing session when browser closed




killing session when browser closed
user name
2007-10-03 01:25:35
Hi there,

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?

Thanks,

EuGeNe -- http://www.3kwa.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: killing session when browser closed
user name
2007-10-03 03:28:23
On 10/3/07, Eugene Van den Bulke <eugene.vandenbulkegmail.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-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: killing session when browser closed
user name
2007-10-03 03:34:03
Hi Arnar,

On 10/3/07, Arnar Birgisson <arnarbigmail.com> wrote:
> 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.

Sounds like exactly what I am looking for, thanks, will try
to figure
that one out (with your "shouldn't eb to hard to
change" reminding me
how noobs I am to all that :P)

cheers,

EuGeNe -- http://www.3kwa.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )