467,109 Members | 1,339 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,109 developers. It's quick & easy.

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?user_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:

---------------------------------------
Expand|Select|Wrap|Line Numbers
  1. my $cgi = CGI->new;
  2.  
  3. my $login_user_id = $cgi->param('user_id');    
  4.  
  5. ########### -- Creating The session--##################
  6.  
  7. my $session = CGI::Session->new( undef, $cgi, {Directory=>'/tmp'} );
  8. my $cookie = $cgi->cookie(CGISESSID => $session->id );
  9. print $cgi->header(-cookie=>$cookie);
  10.  
  11. print $cgi->start_html("ADD CATEGORY");
  12.  
---------------------------------------
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 :-(
Jul 29 '08 #1
  • viewed: 1106
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by | last post: by
9 posts views Thread by Bartosz Wegrzyn | last post: by
8 posts views Thread by Ashish | last post: by
1 post views Thread by Andrew | last post: by
reply views Thread by Alexander Widera | last post: by
2 posts views Thread by Tom | last post: by
reply views Thread by fiefie.niles@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.