in reply to $ENV{'HTTP_COOKIE'} keep returning null even though ive created the cookie

Without some code to work with it's hard to tell what could possibly do that.

Try to post some code in order to get any assistance. plus you should always use CGI.pm


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/
  • Comment on Re: $ENV{'HTTP_COOKIE'} keep returning null even though ive created the cookie

Replies are listed 'Best First'.
$ENV{'HTTP_COOKIE'} keeps returning null even though ive created the cookie - thanks for the quick reply
by Baz (Friar) on Aug 27, 2001 at 03:00 UTC
    Thanx again, here's my code the file is named: http://cgi.tripod.com/aine_canby/cgi-bin/yop.cgi ------------------------------------------------------- Code ------------------------------------------------------- #!/usr/local/bin/perl -w use strict; use CGI; my $query = new CGI; my $cookie_out = $query->cookie( -name=>"MY_NAME", -value=>"Barry Griffin", -expires=>'+24h', -path=>'/aine_canby/cgi-bin', -domain=>'cgi.tripod.com', -secure=>0 ); print $query->header(-cookie=>$cookie_out); print $query->start_html("Cookie Test"); # DEBUG TO SCREEN print $query->p; print $query->header(-cookie=>$cookie_out); print $query->p; my $cookie_in = $query->cookie("MY_NAME"); if($cookie_in) { print $cookie_in; } else { print "Can't find the cookie"; } print $query->p; print $query->end_html; ---------------------------------------------------------- BROWSER DISPLAYS ---------------------------------------------------------- Set-cookie: MY_NAME=Barry%20Griffin; domain=cgi.tripod.com; path=/aine +_canby/cgi-bin; expires=Monday, 27-Aug-2001 22:50:49 GMT Content-type +: text/html Can't find the cookie ----------------------------------------------------------- Cookie Contains - MY_NAME Barry%20Griffin cgi.tripod.com/aine_canby/cgi-bin 0 782699264 29437766 42193056 29437564 *
Re: Re: $ENV{'HTTP_COOKIE'} keep returning null even though ive created the cookie
by bladx (Chaplain) on Aug 27, 2001 at 01:32 UTC
    I agree with Chady, it is a bit hard to help out without seeing your code.

    Also, yes, ALWAYS, I repeat, always use CGI.pm, since it is bundled with most Perl distro's now days, leaving no excuses (usually) about "oh I can't user CGI.pm since my server doesn't support, etc."

    Last but not least, I would suggest choosing another server to do this work on... perhaps you should see jcwren's homenode, and find about Perlmonk where you can get free testing space for your stuff!

    Andy Summers