Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 29th, 2008, 10:14 AM
Newbie
 
Join Date: Jul 2008
Location: India
Posts: 1
Default 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 :-(
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles