This is in reply to your newest post, I can't seem to reply to it as it's below my current viewable thread or something.

I tried setting the cookie as another scalar like you requested, but it hasn't done anything. Maybe I am confused as to what I'm supposed to be doing with it. I set the cookie as another scalar, but then am I supposed to compare it within the password verification section (if ( $adminpass eq $adminpassword ) {)?

I'm sorry, I'm just really clueless and I've never understood cookies or how they work or anything..and I HAVE read tutorials and the CGI docs on them. This is just one concept I don't think I'll ever be able to understand :(

My current code:
my $adminpassword = "test"; my %cookie; my $pass = cookie('cookie'); require SDBM_File; my %mail; my $person = url_param('lookup'); if ( !exists $cookie{'pass'} ) { if ( param() ) { my $adminpass = param('admin'); if ( $adminpass eq $adminpassword ) { my $cookiename = cookie( -name => 'cookie', -value => 'loggedin', -path => '/', -expires => '+3y' ); print header, start_html(); # print rest of page here print "you are logged in"; ##### database value lookup if ($person) { if (exists $mail{$person}) { my $lookup_data = $mail{$person}; print "$lookup_data"; } else { print "<h3><font color=red>Error:</font></h3> This user doesn't exist" +; } } else{ foreach (keys %snailmail) { print <<"END"; <a href="www.myscript.com/login.pl?lookup=$_" target="_new">$_</a><br> END } } } else { print header, start_html(); print "Incorrect password, please click back and try again +"; exit; } } else { print header, start_html(); print start_form(), table( Tr( td("Admin Password: "), td( textfield( -name => 'admin', -size => 10 ) ) ), Tr( td(), td(submit) ), ), end_form(), hr(); } }

In reply to Re: Re: Re: Re: Cookie not getting stores by Anonymous Monk
in thread Cookie not getting stores by Anonymous Monk

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.