Works for me once you define the variables being passed into the cookie method.
#!/usr/bin/perl -w use strict; use CGI; use CGI::Cookie; my $q = CGI->new(); my ($username, $secret) = ('wowza','special'); my $set_username = $q->cookie( -name => "user_name", -value => $username, -expires => "+1d", ); my $set_session = $q->cookie( -name => "session", -value => $secret, -expires => "+1d", ); print $q->header( -cookie=>[$set_session, $set_username], $q->redirect +(q|http://www.google.com/|)); #print $q->header(); print $q->html($q->body($q->h1('hi there'))); 1;
Celebrate Intellectual Diversity
In reply to Re: CGI error: "Invalid header value contains a newline not followed by whitespace"
by InfiniteSilence
in thread CGI error: "Invalid header value contains a newline not followed by whitespace"
by MyMonkName
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |