Hi all, can anyone help with the following code that sets a cookie?
#!/usr/bin/perl -wT use strict; use CGI qw(:standard); my $cookie1 = cookie(-name => 'username2', -value => 'Barney Rubble', -expires => '+1y' ); print header( -cookie => $cookie1 ); print qq (Another cookie has been set in your browser ...<p>); print qq(<a href="ex_5_4.pl">); print qq(Click to view the cookie</a>); ####################################################### Another script is supposed to read out the value. ############################################### #!/usr/bin/perl -wT use strict; use CGI qw(:standard); my $old_value = cookie('username'); my $new_value = cookie('username2'); print header; print qq(The new cookie <b>username2</b>); print qq(contains <b>$new_value</b><p>); print qq(The old cookie <b>username</b>); print qq(contains <b>$old_value</b>); ############################################### The cookie is set and but it's value isn't passed to the second script. What irritates me is that I can set and read cookies and their values when I set them manually using the ($key, $value) = split(/=/, $ENV{HTTP_COOKIE}) to parse the script. Both scripts are examples from Brent Michalski's and Kevin Meltzer's book "Writing CGI Applications with Perl" but there are no hints on their webpage that anything is wrong with the code and I've also tried the source code examples on their site which didn' t work either. Any hints????? Marcus Willemsen Online Redaktion Juve Verlag Agrippastr. 10 50676 Köln tel: ++49(0)221 91 38 80 16 fax: ++49(0)221 91 38 80 18 www.juve.de [EMAIL PROTECTED] [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]