Click here to get back home

Session Expiration Problem

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Session Expiration Problem Praki 02-25-2008
Get Chitika Premium
Posted by Praki on February 25, 2008, 5:48 am
Please log in for more thread options
Hi All,

This is the coding i have writtern to create the session in Perl.but i
getting session expired with in 5 min even if i m contineously wroking
onthe page.

$userid = $FORM;
$password = $FORM;

$session = new CGI::Session("driver:File",undef,{'Directory'=>"/
tmp"});
$sid = $session->id();

# Write the session variable on the server
$session->param('username',$userid);
# $session->param('password',$password);

#create session cookie
$cookie = $query->cookie(CGISESSID => $session->id);

#session expire
$session->expire('+24h');

this code checks for the session existence


$session = new CGI::Session(undef, $sid, );
        print $query->header( -cookie=>$cookie );
$username_session = $session->param('username');
        if ($username_session eq "") {
                &print_session_exp_header(" -- Session Expired -- ","Session
Expired.");
                print "<h5>Please Relogin in Different Browser</h5>";
         &print_trailer();
                exit(0);
        }

i dont know where i m going wrong.
can anyone plz correct with i have done any mistake or pointer to
correct the mistake.

thaks in advance
prakash

Similar ThreadsPosted
Session Problem in Perl December 11, 2007, 10:55 am
Problem with garbage in serialized CGI::Session files September 29, 2004, 9:23 am
perl cgi session module installation problem. June 5, 2006, 9:31 am
mod_perl locking problem with Apache::Session December 30, 2007, 12:53 am
setting of session values from a script for the same session in which it is running May 23, 2005, 12:35 am
new CGI::Session creates a new session every visit. GRRR!!! March 15, 2007, 6:43 pm
CGI::Session How can a session be not expired and at the same time empty? June 14, 2007, 3:56 pm
CGI:Session porting to Apache:Session June 25, 2005, 10:31 pm
creating a new session when a session is expired May 17, 2006, 8:21 am
Set ENV on different session August 6, 2004, 4:36 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap