I have a cgi script that is supposed to redirect the user on success. I was running it on a somewhat antiquated version of Ubuntu, and when I upgraded it to Lucid (running Perl 5.10.1 under apache 2.2.14), it stopped working. The error message is,
Invalid header value contains a newline not followed by whitespace: status: 302 found location: http://localhost/
The relevant code seems to be this:
my $set_username = $q->cookie( -name => "user_name", -value => $user_name, -expires => "+1d", ); my $set_session = $q->cookie( -name => "session", -value => $secret, -expires => "+1d", ); print $q->header( -cookie => [ $set_session, $set_username ], $q->redirect("http://localhost/"));
I've tried chomping the relevant variables, adding whitespace, etc., but it doesn't seem to help. As you may have guessed, it is a login script. Does anybody have any pointers on how to fix this?
Thanks!In reply to CGI error: "Invalid header value contains a newline not followed by whitespace" by MyMonkName
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |