How to read a cookie when path variable is different(Not default)
| From: | Lenka, Bibhu Kalyan | Date: | Thu, 07 Jul 2005 17:34:52 +0000 |
| Subject: | How to read a cookie when path variable is different(Not default) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-218306@lists.php.net to get a copy of this message | ||
Hi, I am new to forum ,It may look as a simple problem, but I am not
able to solve this.
In following code , I have hard coded the path while setting cookie, now
how I read it through PHP ?
echo("cookie value name is : $name"); // this do not return anything.
Thanks,
Bibhu
<HTML>
<HEAD>
<TITLE>IWIN Search</TITLE>
<script>
function setCookie()
{
var expire = new Date();
expire.setTime(expire.getTime() + 2592000000);
document.cookie= "name= test; expires=" + expire.toGMTString() +
";domain=.schwab.com;path=/iwin2005";
}
</script>
<body onLoad='setCookie()'>
<?php
echo("cookie value name is : $name");
?>
</body>