poolboi has asked for the wisdom of the Perl Monks concerning the following question:

hey guys, not sure if u guys are experiencing the same problem in CGI::Sesson this code
if($session->is_expired) { print $cgi->header(-cache_control=>"no-cache, no-store, must-rev +alidate"); print "<p>Your has session expired. Please login again.<p></br>" +; print "<a href='http://localhost//cgi-bin//mml%20log//login.pl'> +Login</a>"; } elsif ($session->is_empty) { print $cgi->header(-cache_control=>"no-cache, no-store, must-rev +alidate"); print "You have not logged in"; }
doesn't seem to detect an expired session even when my session has expired it always check that the session is empty even though my session actually expired so i'm not sure if anyoe using this module has experienced the same problems before

Replies are listed 'Best First'.
Re: is_expired and is_empty doubt in CGI::Session
by Herkum (Parson) on Jun 02, 2008 at 04:38 UTC

    CGI::Session is a fairly common module. I find that it is sometimes confusing, but I would be surprised if it has any major bugs in it.

    You should probably take another look at what you are doing and if you are still having problems, try included more code a better description of what you are trying to accomplish. There is not much here that anyone could really help with.

Re: is_expired and is_empty doubt in CGI::Session
by Gangabass (Vicar) on Jun 02, 2008 at 04:46 UTC

    Do you load() your session?

    $s = CGI::Session->load() or die CGI::Session->errstr;
    A reply falls below the community's threshold of quality. You may see it by logging in.