I know this isnt answering your question, but skip cookies and goto
sessions, easier to work with.

now the answer to your question, you need to set the domain and path on your
setcookie()

setcookie('name', 'value', $exp, '/', $SERVER_NAME);

--

  Chris Lee
  [EMAIL PROTECTED]



"Steve Osborne" <[EMAIL PROTECTED]> wrote in message
001701c1829d$90a519a0$[EMAIL PROTECTED]">news:001701c1829d$90a519a0$[EMAIL PROTECTED]...
> Can someone tell me if there is a bit of code I need to put on pages so I
> can retrieve a cookie.
> The cookie was set with the following code:
>
> //(D) Set Cookie
>    $encoded_login = encode_string($login);
>    if ( $remember == "yes" ){
>     // set login to expire in 1000 days
>     $time = (time() + ( 24 * 3600 * 365 ));
>     SetCookie ( "poccd_session", $encoded_login, $time);
>    }else{
>     SetCookie ( "poccd_session", $encoded_login );
>    }
>
> I am trying to retrieve it with the following code (for testing purposes
> only, right now):
>
> if($poccd_session)
> {
>  header("location: index.php");
> }else{
>  print("The cookie plan didn't work.....");
> }
>
> Any suggestions would be appreciated.
>
> Steve Osborne
> Database Programmer
> Chinook Multimedia Inc.
> [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to