Re: How to read a cookie when path variable is different(Not default)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, July 7, 2005 10:34 am, Lenka, Bibhu Kalyan said:
> 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.

I dunno why you'd want to use flaky, unreliable, complicated JavaScript to
set the cookie instead of http://php.net/setcookie but if the JavaScript
worked in the first place, you'd have your cookie in:

$_COOKIE['name']

> 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>
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux