Yaerox has asked for the wisdom of the Perl Monks concerning the following question:
# Includes use strict; use warnings; use CGI; use DBI; use Digest::MD5 qw(md5 md5_hex md5_base64); # Get Parameters my $p_sUsername = param( 'username' ); my $p_sPassword = param( 'password' ); $p_sPassword = md5_hex( $p_sPassword ); if ( !defined( $p_sUsername ) || !defined( $p_sPassword ) ) { print redirect( "access-denied.pl" ); } # DB Stuff done here ... my $oCGI = CGI->new(); my $oCookie = $oCGI->cookie( -name => "user", -value => $p_sUsername -expires=>'2h' ); print redirect( "result.pl", $oCookie );
What am I doing wrong? I need to pass data from page to page to be able to check if a user is authenticated or not ...my $oCGI = CGI->new(); print $oCGI->cookie('user'); # this is empty
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Sessions and Cookies - Cookie don't get passed
by Your Mother (Archbishop) on Mar 05, 2015 at 20:53 UTC | |
by Yaerox (Scribe) on Mar 06, 2015 at 08:12 UTC | |
|
Re: Perl Sessions and Cookies - Cookie don't get passed
by fishmonger (Chaplain) on Mar 05, 2015 at 14:49 UTC | |
by Yaerox (Scribe) on Mar 05, 2015 at 15:36 UTC | |
by cheako (Beadle) on Mar 05, 2015 at 19:16 UTC | |
by Anonymous Monk on Mar 06, 2015 at 13:41 UTC | |
by cheako (Beadle) on Mar 06, 2015 at 18:31 UTC | |
|