Setting Cookie problem
| From: | Mike Lee | Date: | Mon, 08 Dec 2003 22:38:51 +0000 |
| Subject: | Setting Cookie problem | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22338@lists.php.net to get a copy of this message | ||
Hello,
[Using Apache 2.0.47 with PHP 4.3 with IE.6(allowing
cookies)]
I have made previous php pages so just to confirm that
the configuration for php IS working :)
I created the page(below) from a tutorial for setting
cookies. But the cookie itself doesn't get stored(as I
have debuged in the code)
I have also used a program called
tcpTrace(http://www.pocketsoap.com/tcptrace/) which
outputs the sent/received message (including HTTP
headers) and this doesn't show the 'Cookie:blah=blah'
attribute when accessing the page below either.
Any suggestions/experience on the annoying problem
would be much appreciated!
Cheers,
Mike.
This is code of 'cookies.php':
<?php
if(isset($value))
{
SetCookie("mycookie",$value,time()+3600);
}
?>
<html>
<head>
<title>Cookie test script</title>
</head>
<body>
<?PHP print('mycookie = ' . $mycookie); ?>
<br>
<?php print_r($_COOKIE); ?> // for debug
//nothing appears
<form action="" method="post">
Type value: <input name="value" type="text">
<input name="submit" type="submit">
</form>
</body>
</html>
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/