John Mudd
mudd at vex.net
Thu Apr 1 06:48:52 EST 2004
I want to avoid incorrectly announcing "session expired" to truly new users. In the case of a new user I'd rather say something like "welcome new user" or give extra help with their first login attempt. For now I'm using pysqlite (so cool!) to setup a "hits" table on disk. I now keep track of the number of hits for each remote IP addr. I check the table for each hit. If I get an IP address that's not in the table then I add it and treat that session as a new user. Any other time I see a new session I treat it as an expired session. I think it's interesting that you say you get a new session if apache is restarted, I don't see that behavior. Maybe that's because my sessions are being stored in a dbm file. My sessions only expire due to timeout which is good for me. Thanks for your response, John On Thu, 2004-04-01 at 03:46, Manera, Villiam wrote: > I'm using session since 5 month in production environment without problem > as follow: > > 1) login ---> new session,timeout=xxx > 2) for any other access from this user I tested is_new() that become tru > only for timeout expired or > restart of apache (or ... bug in our programs). So the only message to the > user is : timeout expired > > why the need to distinguish from new and expired? > > Villiam > -----Messaggio originale----- > Da: mod_python-bounces at modpython.org > [mailto:mod_python-bounces at modpython.org]Per conto di John Mudd > Inviato: mercoledì 31 marzo 2004 22.02 > A: Gregory (Grisha) "Trubetskoy > Cc: mpMailList > Oggetto: Re: [mod_python] session.last_accessed() ? > > > 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). > > John > > > On Wed, 2004-03-31 at 14:52, Gregory (Grisha) Trubetskoy wrote: > > This is a bug clearly... I suppose a workaround would be to store your own > > date until we have this fixed. > > > > Grisha > > > > On Wed, 31 Mar 2004, John Mudd wrote: > > > > > What good is session.last_accessed() ? > > > > > > It seems to return the time that I created the session object or last > > > read it from disk. Which tells me nothing of interest. > > > > > > I'd like to how long since the session was previously (if ever) saved to > > > disk. Is there a way to get that? > > > > > > John > > > > > > _______________________________________________ > > > Mod_python mailing list > > > Mod_python at modpython.org > > > http://mailman.modpython.org/mailman/listinfo/mod_python > > > > > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python
|