Session Expiration Problem

P

Praki

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{'uid'};
$password = $FORM{'password'};

$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, {Directory=>'/tmp'});
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top