[Seaside] Fatal Flaw in my Web App!
Richard K Eng
richard.eng at rogers.com
Fri May 23 19:48:00 UTC 2008
"Oh, I see!" said the blind man as he picked up his hammer and saw. From the
Seaside.st FAQ:
>From time to time, Seaside processes expired sessions (see
#unregisterExpiredHandlers). Expired sessions are removed from Seaside,
making them candidates for future garbage collections, then they are sent
#unregistered. The standard implementation of #unregistered in WASession is
empty.
#unregistered is sent *when garbage collection is done*. It's not
necessarily executed immediately. I should've read the FAQ more carefully.
Richard
----- Original Message -----
From: "Richard K Eng" <richard.eng at rogers.com>
To: "Seaside - general discussion" <seaside at lists.squeakfoundation.org>
Sent: Friday, May 23, 2008 3:31 PM
Subject: Re: [Seaside] Fatal Flaw in my Web App!
>I have a puzzling problem. I've made some changes to do what you suggest.
>I've subclassed WASession:
>
> WASession subclass: #GSSession
>
> ...with instance variable #database. I've created #unregistered as
> follows:
>
> unregistered
> database ifNotNil: [database logout].
> super unregistered
>
> I've put the following in #GSRegistrationLogin (my root component for the
> app):
>
> self application preferenceAt: #sessionClass put: GSSession
>
> And when the user logs out, the following is executed:
>
> html anchor
> callback: [self session expire];
> with: [html paragraph style: 'color: red'; with: [html strong:
> 'Logout']]
>
> But the #unregistered doesn't always get executed. Sometimes, not at all!
> And sometimes, much later, as in the *next* time I login and logout (?!).
> What am I doing wrong?!! Shouldn't session expiry *always* cause
> #unregistered to execute?
>
> Thanks,
> Richard
>
> ----------------
> John wrote:
>
> I usually store my glorp session on the seaside session, and upon
> expiring, it sends logout to the glorp session.
>
> This has the dual benefit of the above, and having easy accessor to
> glorp in the form of:
>
> self session glorpSession
>
> anywhere in my Tasks/Components.
>
> John
More information about the seaside
mailing list