CGI-Session - Session expiry- Issues

Posted on Fri Jan 19 02:47:10 2007 by tomtom
Session expiry- Issues
I have the following code in my Athentication handler.
my $session = new CGI::Session() or die CGI::Session -> errstr; $session = new CGI::Session(undef, undef, {Directory => '../tmp/sessions'});
I just wanted to know How to cleanup the sessions inside the ../tmp/sessions folder. Will the files get deleted as part of the session expiry. Also if we instantiate $session like this, Is it all right to have following statements that is is_expired or is_empty with context to the above
if ( $session->is_expired ) { ## die "Your session is expired. Please refresh your browser to re-start your session"; $session = $session->new(); } if ( $session->is_empty ) { $session = $session->new(); }
Write a response