Problem in CGI Session

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d0353101
    New Member
    • Jul 2008
    • 4

    Problem in CGI Session

    I am having login.cgi. user enter id and password. if ok it redirects to main.cgi with user_id as main_page.cgi?u ser_id=$user_id .

    main.cgi is having left menu and right part is for doing some action.

    in all the CGI files including main.cgi I am writing this code before start_html to manage the session:

    ---------------------------------------
    Code:
    my $cgi = CGI->new;
    
    my $login_user_id = $cgi->param('user_id');    
    
    ########### -- Creating The session--##################
    
    my $session = CGI::Session->new( undef, $cgi, {Directory=>'/tmp'} );
    my $cookie = $cgi->cookie(CGISESSID => $session->id );
    print $cgi->header(-cookie=>$cookie);
    
    print $cgi->start_html("ADD CATEGORY");
    ---------------------------------------
    But when I click any link (like add payment) on the left menu. a new session is getting created every time.

    Please help... I dont want a new session.

    I m stuck in it since last 2 days and getting dumbheaded. Please help :-(
Working...