[mod_python] session.last_accessed() ?

Bill Anderson bill at immosys.com
Wed Mar 31 14:13:52 EST 2004

On Wed, 2004-03-31 at 13:02, John Mudd wrote:
> Thanks.
> I started to add my own time stamp and then realized that even that
> won't solve my original problem.  
> What I really want to know if whether a new session object was created
> because (1) there was never a session for this client before or (2) the
> previous session has since expired.  I can tell if a session object is
> new thanks to the is_new() method but not whether an old session
> expired.  If I know then I can tell the client user why they have to
> login again (e.g. the session expired).

Hmmm you could store a cookie with a value of "has logged in before" or
go with a "Your session may have expired or you have not logged in using
this browser before".

Or if you store user data somewhere (some sort of DB) you might have a
flag that indicates if they have logged in before and act accordingly as

Just some thoughts.

Bill Anderson <bill at immosys.com>
Immosys LLC

More information about the Mod_python mailing list