durusmail: quixote-users: Session timeout (was cookie expiration)
Cookie expiration
2005-02-04
2005-02-04
Session timeout (was cookie expiration)
2005-02-04
2005-02-04
Session timeout (was cookie expiration)
Titus Brown
2005-02-04
-> Sorry, I was not very explicit - this should have been 'cookie / session
-> timeout' - that is, when a session has no activity for, say, 20 minutes, the
-> session / cookie becomes invalid.

Hi, Robert,

I think if you override the 'get()' function in the dictionary storing
functions, you will have the right behavior.  Basically you want to look
at the Session._access_time variable to decide whether or not a
particular session object is worth returning.

It's actually a bit harder to do it in the default Session code (which
isn't persistent) because you have to subclass a dictionary.  If you're
using a persistence mechanism, you can simply decide not to load into
memory sessions that haven't been accessed recently.

For example, in

        http://darcs.idyll.org/~t/projects/sql_example/session.py

change the 'SELECT' command to add

        WHERE access_time > now() - '1 hour'::INTERVAL

or some such.

hope this helps,
--titus

p.s. This is for Quixote 1.2.  Don't know anything about 2.0...

reply