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!

PHP Cookie Problem

Status
Not open for further replies.

Dynamo3209

Programmer
Jan 2, 2003
57
0
0
US
I am setting a cookie, and when I try reading or printing the cookie value ($_COOKIE[cookie_name]), Netscape prints out the cookie value, however IE doesn't seem to read the cookie. Are the cookies handled differently by IE and Netscape.

Thanks,
Dynamo
 
Obviously. ;)
Be careful with stating the cookies expiration date/time in the right format. IE will not forgive you if it's not right.
 
I am setting the cookie as

setcookie(User,$UserNameEmail,time()+86400,"/",$argumentstring1,0);
where argumentstring1 is the domain on which the cookie is set and $UserNameEmail is the email address.

However IE doesn't seem to read the cookie where as Netscape can.
 
hiya,
I found absolutely no problem reading the cookie in ie6
Used some sample data:
Code:
<?php
$UserNameEmail = 'jr@somewhat.com';
$argumentstring1 = '127.0.0.1';

setcookie(User,$UserNameEmail,time()+86400,"/",$argumentstring1,0);
?>
Code:
<?
  echo $_COOKIE["User"]; 
?>

JR
(In need of a cool signature)
 
By the way (dumb question I know) is your IE accepting cookies? Can you actually find it back on your PC?

JR
(In need of a cool signature)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top