[mod_python] How to check if session is created because of old session expired?

Graham Dumpleton graham.dumpleton at gmail.com
Tue Aug 5 06:40:09 EDT 2008

2008/8/5 Radosław Rymaszewski <rrymaszewski at contentforces.pl>:
>>> Maybe it could be good to add information in new session when old
>>> session expired?
>> And how is it supposed to do that without keeping forever a record of
>> all old sessions?
> In my opinion if there is flag (1) for new session so if You are
> checking old one and it's expired then You can use flag (e.g. 2)
> instead of (1).
> Function is_new() for this two flags will return True in both cases so
> there should not be problem with it  (in almost all cases ;-).
> You don't need to keep this information forever, because You need to
> check this only once. You can delete this information similar to
> is_new flag is deleted.
> Of course old sessions could be marked to be clean up.
> Please correct me if I am wrong, because I didn't check how works
> creating new session after old session expired.

But as I said, unless you keep details of the session in the session
database, you will not know if it is an expired session. Thus the
session database would bloat out with old crap. Yes you could have two
levels of expiry, that is, session expiry time and the session data
expiry/purge timeout, but you still could be hitting the second case.
Thus your application has to cope some how with loss of session
information anyway, so why not just deal with it.



More information about the Mod_python mailing list