Help for this page

Select Code to Download


  1. or download this
    if ($usr eq 'admin' && $pwd eq 'admin') {
    $cookie = ...;
    ...
    print "Set-Cookie: login="$cookie"\r\n\r\n";
    ...
    }
    
  2. or download this
    my $cipher = Crypt::CBC->new(-key=>$secret_key, -cipher => 'Rijndael')
    +;
    my $cookie = MIME::Base64::encode_base64($cipher->encrypt("$usr:$pwd")
    +, '');