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


In reply to session variables by rjsaulakh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.