#!/usr/bin/perl $| = 1; use strict; use warnings; use CGI; use CGI::Cookie; my $cgi = new CGI; my $c = new CGI::Cookie; use Data::Dumper; my $val = 'Ruth WzAZMuffOotJuZ1Ra12xZWl4dw /'; $c = new CGI::Cookie(-name => 'login', -value => $val, -expires => '+1d', -domain => 'test' ); print $cgi->header( -cookie=>$c); print $cgi->start_html, $cgi->h1('Cookietest'), $cgi->p('with ' . $ENV{HTTP_USER_AGENT}), $cgi->p('Cookie read back with JavaScript'), $cgi->p( $cgi->script( {-type=>'text/javascript'},'document.write(document.cookie);'), $cgi->noscript( $cgi->h1({ -style=>'color:darkred' },'Please activate Javascript to run the test!')), ), $cgi->p($cgi->b('In Reality Cookie is [DEBUGCODE]: ', $cgi->br, Dumper($c) ) ), $cgi->end_html; 1;