Re: [Cgi-session-user] Help required
Brought to you by:
sherzodr
From: Thomas M. P. <pa...@ph...> - 2007-07-27 02:57:57
|
I tried running something based on the code you gave on my system, CGI::Session::VERSION 4.14. IT's somewhat late, and I have not really used the load method before, but it seems that on the expiration of the session, load is returning an empty but non-expired session. I print to STDERR assorted info on the session right after the load. After the initial call to the script, I get an unexpired but empty session, with no access/creation time or expiration. On subsequent calls within the expiry period, the session is not empty, not expired, and the access/creation times are as expected. After waiting the expiration time, I again get an empty but non-expired session. So it looks like there is something subtly wrong with the load method, unless I am missing something. I am not really sure why you are using load instead of new. Normally, I just use the new method and let CGI::Session create new or load existing sessions as it wants, using a field in the session to determine whether user already authenticated. This field(s) has the expiration set, which allows me to require the user to re-login if inactive but without losing all the session based info (i.e. only delete stuff which is considered sensitive enough to need to relogin for). On Thu, 26 Jul 2007, Jahangir Mohammed wrote: > Hello , > > I have a weird problem. > > Problem : The session doesnt expire at all in my cgi script. > > Purpose : To expire the session and show the user login form > after the user is idle for 2 minutes. > > Details: > I am using CGI::Session's 4.20 version. > > I am trying to use this module for authentication purposes. > Once the user is authenticated,I write the following code : > my $session = CGI::Session->load() or die CGI::Session->errstr; > if ( $session->is_expired ) { > die "Your session expired. Please refresh your browser to re-start > your session"; > } > $CGISESSID = $session->id(); ***************This generates id > successully************** > $session->expire('+1m'); *********** Doesn't expire my session************ > > The only problem I could think is that I have force installed this module. > Can anyone let me know why are there so many problems in > installation ? > Kindly go through the log file attached. > > Thanks a lot, > Jahangir. > Tom Payerle Dept of Physics pa...@ph... University of Maryland (301) 405-6973 College Park, MD 20742-4111 Fax: (301) 314-9525 |