Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI.pm vs. netscape cookies

Status
Not open for further replies.

steam

ISP
Jul 17, 2000
51
0
0
IT
Hi again ... Netscape is not getting any cookie with this code:

----------
$session=int(rand(1000000000)).$$;

$cookie = $query->cookie(-name=>'usersession',
-value=>$session,
-path=>'/',
-domain=>'.mydomain.com',
-expires=>'+10h');

print $query->header(-cookie=>$cookie);

----------

MSIE is working ;)
Any suggestions?

Thanks.
 
I hate to ask, but, ???? cookies are enabled ???? It would be nice if it were that simple.


keep the rudder amid ship and beware the odd typo
 
This isn't very likely, but do you have any meta tag redirect statements?
(<meta http-equiv=refresh content=&quot;1; URL=http://mysite&quot;>)

I've noticed that if the content is set to 0, the cookie will set in IE, but not Netscape...

 
How are you coming to the conclusion that no cookie is being set? Do you realize that after setting a cookie, that that cookie won't be seen until the *next* page is displayed, since the new cookie(s) are actually part of the headers of that next page(and subsequent pages)?
Your code looks OK to me. I'm not familiar with the &quot;path&quot; parameter - the only thing that may look &quot;not right&quot; is the slash in path - you might need to escape the slash with a backslash. Other than that I can't see anything wrong.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top