Cookie Retrieval
| From: | Steve Osborne | Date: | Tue, 11 Dec 2001 23:42:58 +0000 |
| Subject: | Cookie Retrieval | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77368@lists.php.net to get a copy of this message | ||
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.
s.osborne@chinookmultimedia.com