daynite has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I have a problem with Perl-CGI script. I tried logout for my web page. It is working fine, but i cant able to pass cookies. I have login page in test.cgi.... how to pass user name('$user') to show.cgi page... or is there any way to retrive it in show.cgi page...any one please give me a way..
Below is the test.cgi script,
#!/usr/bin/perl use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use CGI::Session ( '-ip_match' ); my $q=new CGI; my $user = $q->param('usr'); my $pwd = $q->param('pwd'); if($user ne '' and $pwd ne '') { if($user eq "monk" and $pwd eq "hi") { $session = new CGI::Session(); print $session->header(-location=>'show.cgi'); } else { print $q->header(-type=>"text/html",-location=>"test.cgi"); } } elsif($q->param('action') eq 'logout') { $session = CGI::Session->load() or die CGI::Session->errstr; $session->delete(); print $session->header(-location=>'test.cgi'); } else { print $q->header; print start_html; print <≤EndHTML; ---------loginpage--------- EndHTML print end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help on cookies
by Your Mother (Archbishop) on May 27, 2009 at 17:56 UTC | |
|
Re: Help on cookies
by Anonymous Monk on May 27, 2009 at 14:15 UTC |