i will try to explain what i want trying to accomplish
i am having a html loginpage through which the user tries to login and after that he can view database and also update it depending on the priveledges he has
i need to maintain session variables for username,password , login time , logout time , parts of database he has viweed and parts which he has edited
i should be able to have n number of session variables depending on my requirement
i have to write this code in CGI/perl
can some please help me how can i accomplish this task
please give me some guidelines so that i can work on the same
i have also tried to write a code where i can have session variables for login name , logout time , login time and others
#!c:\Perl\bin\perl.exe -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
#die "Bad error here";
use CGI;
use CGI::Cookie;
use Data::Dumper;
use CGI::Session;
my $cgi = new CGI;
#Generating a new session
my $session = new CGI::Session("driver:File", undef,
{
+
#giving the directory where the session var
+iables will be stored
Directory=>"\\B2R6A056A\wwwroot\Amexpmo\lo
+gin\amex\raman"
}
)
#incase of any error the session close giving an error
or die $CGI::Session::errstr;
print $cgi->header;
print $cgi->start_html;
#print <<HERE;
#<b>jkasgdf</b>
use constant SESSION_COOKIE => "MY_SITE_SIDE";
my $sid = $cgi->cookie("SESSION_COOKIE") || $cgi->param("sid") || unde
+f;
#creating a new session
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->param(-name => SESSION_COOKIE,
-value => $session->id,
#sessiion expires after 3 hours
-expires=>"+3h");
print $cgi->header(-cookie=>$cookie);
$session->save_param($cgi, ["userid", "password"]);
# this line saves all the available/accessible CGI params
$session->save_param($cgi);
#using data:;dumper to print the session variables getting stored
print Dumper(\$session);
i am using IIS server for the same and working with windows