in reply to Pulling out the value of a cookie: Revisited
UpdateWarrenBullockIII, I apologise. I (eventually) saw your comment in the CB and revisited your question and your right, I hadn't read all of your post.
I would have apologised in the CB, but my link is subject to a extreme lag at the moment.
End update The rest of this post is wrong/redundant.
Don't bother...
The immediate problem is caused by
$cook = $ENV{'HTTP_COOKIE'}; @cookies = split /;/, $cook; foreach $new (@cookies){ print "Welcome back:" . $new; } print "</PRE>\n";
The $ENV('HTTP_COOKIE'); is returning something like: 'user=john;something=something;another=more;'
So, $new will be xxxx=yyyy inside the loop.
adding a line
$new =~ s/^user=(.*)/$1)/;
Would fix the immediate problem, but the bigger problem is mixing the use of cgi->cookie and messing with HTTP_COOKIE. Use one or the other (prefereably CGI and drop HTTP_COOKIE).
|
|---|