Logging out a session (and doing any necessary cleanup)..

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging out a session (and doing any necessary cleanup)..

Rick Flower
Hi all.. Just curious what message I need to send or whatever other
steps are needed in order to logout a session that is subclassed from
WASession?  In this case, I'm not referring to timed out sessions, but
rather implicit logouts.. This would allow me to cleanup any crud that
was session specific (database connections, etc), etc.  On a side note,
if I've got a database connection open (in my session object) and the
session times out over a period of time, is there a way to get some sort
of callback to allow my application to do its necessary cleanup or is
there some sort of magic behind the scenes that takes care of it for me
automatically (like when the session is destroyed after the timeout is
detected)?

Thanks!

-- Rick


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Logging out a session (and doing any necessary cleanup)..

William Harford

On Mar 17, 2006, at 12:00 PM, Rick Flower wrote:

> Hi all.. Just curious what message I need to send or whatever other  
> steps are needed in order to logout a session that is subclassed  
> from WASession?

#expire.

> In this case, I'm not referring to timed out sessions, but rather  
> implicit logouts.. This would allow me to cleanup any crud that was  
> session specific (database connections, etc), etc.

I am not sure if expire cleans up a session when called but...


> On a side note, if I've got a database connection open (in my  
> session object) and the session times out over a period of time, is  
> there a way to get some sort of callback to allow my application to  
> do its necessary cleanup or is there some sort of magic behind the  
> scenes that takes care of it for me automatically (like when the  
> session is destroyed after the timeout is detected)?


Define #unregistered in your session. #unregistered is called when a  
session is destroyed. Expired sessions are destroyed every 20th time  
(I think) a new session is created.

If you need something that does not allow your expired sessions to  
linger around so much you can run a background process that checks  
for expired sessions. There was an example posted on this list a  
while ago and I can't seem to locate it.

Would someone be able to post example code of a background reaper  
process for seaside sessions ?

>
> Thanks!
>
> -- Rick
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside