[Seaside] How to non expire a session?
Avi Bryant
avi.bryant at gmail.com
Wed Feb 16 21:02:02 CET 2005
On Fri, 11 Feb 2005 13:39:56 +0100, Martin J. Laubach <mjl at laubach.at> wrote:
> Is there a way of not expiring the session for a page? In my
> application, users have to login first, so the very first page
> they see is a Username/Password dialog.
>
> Now if they decide to get a cup of coffee before logging in,
> upon filling out the fields and clicking on "login", they
> immediately get the "session has expired", and get redirected
> to... the very same login page.
>
> This is kind of ridiculous -- is there any way to work around
> that? Perhaps starting the session only when the first request
> after the login page comes in? Or tell Seaside that it should
> silently start a new session? Anything?
Hi Martin,
The session gets expired when WASession>>isActive returns false. It
inherits this method from WAExpiringHandler, which checks to see if
there's been any use in the last #timeoutSeconds. One simple way to
achieve your goal would be to subclass WASession and increase the
#timeoutSeconds if the user has not yet logged in. Assuming a #user
method on your session class:
timeoutSeconds
^ self user
ifNil: [6000]
ifNotNil: [super timeoutSeconds]
HTH,
Avi
More information about the Seaside
mailing list