Session Expiration Problem

Discussion in 'Perl Misc' started by Praki, Feb 25, 2008.

  1. Praki

    Praki Guest

    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
    Praki, Feb 25, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vijay

    Redirecting session expiration

    Vijay, Nov 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    340
    Vijay
    Nov 3, 2003
  2. Vijay
    Replies:
    3
    Views:
    1,481
    Saravana [MVP]
    Nov 4, 2003
  3. Anthony Williams
    Replies:
    9
    Views:
    3,622
  4. Replies:
    9
    Views:
    613
    Erwin Moller
    Nov 21, 2003
  5. vyshu
    Replies:
    4
    Views:
    4,374
    Tarkin
    May 4, 2007
Loading...

Share This Page