rjsaulakh has asked for the wisdom of the Perl Monks concerning the following question:
Following is the piece of code i have tried to write please let me know you comments. also i am not getting any display for the same where am i making an error
nor any logs are getting generated for me
#!c:\Perl\bin\perl.exe #PLEASE ENTER THE PATH WHERE YOUR CGI PROGRAM WILL BE STORED -wT use strict; use CGI; use CGI::Cookie; use Data::Dumper; #use CGI::Session::File; my $cgi = new CGI; print $cgi->header; print $cgi->start_html; #print <<HERE; #<b>jkasgdf</b> use constant SESSION_COOKIE => "MY_SITE_SIDE"; my $sid = $cgi->param("sid") || undef; #creating a new session my $session = new CGI::Session::File(undef, {LockDirectory =>"/Amexpmo/login/a +mex/sessionlogs", Directory =>"/Amexpmo/login/amex/ +sessionlogs"}) or die $CGI::Session::errstr; print "Your session id is ", $session->id(); # A cookie is being created which is then being send to the user brows +er my $cookie = $cgi->cookie(CGISESSID => $session->id ); print $cgi->header(-cookie=>$cookie); # $session->save_param($cgi, ["login_name", "password"]); # this line saves all the available/accessible CGI params $session->save_param($cgi); print Dumper(\$session); $session->expire('+3h'); print Dumper; #HERE #print $cgi->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: session handling with cgi
by Joost (Canon) on May 27, 2005 at 13:14 UTC | |
|
Re: session handling with cgi
by ghenry (Vicar) on May 27, 2005 at 13:11 UTC | |
by tlm (Prior) on May 27, 2005 at 13:40 UTC |