head 1.1; branch 1.1.1; access ; symbols ePerl_2_2_14:1.1.1.1 RSE:1.1.1; locks ; strict; comment @# @; 1.1 date 99.05.02.14.43.39; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.05.02.14.43.39; author rse; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @value if ($cookies{$cnt_name}); # increase the value, because its an access counter $cnt_value++; # create the new counter cookie and send it back to the browser my ($myname, $mypath) = ($ENV{'SCRIPT_SRC_URL'} =~ m%^http://(.+?)(?:|:\d+)(/.*)$%); my $cookie = new CGI::Cookie( -name => $cnt_name, -value => sprintf("%d", $cnt_value), -domain => $myname, -path => $mypath, -expires => '+24h' ); print "Set-Cookie: $cookie\n"; !> demo.cgipm

demo.cgipm

High-level HTTP programming with CGI.pm

This demonstrates how one can create complex HTTP headers like Netscape Cookies by programming them via Perl's CGI::Cookie module.

You have accessed this demo times now. This counter is stored in a cookie, so push your RELOAD button a few times to see the effect.

@ 1.1.1.1 log @Import of ePerl 2.2.14 @ text @@