Try this:
// Set Cookie if not already set
if (!isset($user_id)) {
$token = md5(uniqid(rand()));
setcookie("user_id", $token, time()+3600,"/",".yourdomain.com");
}
look at the setcookie function on php.net to figure out all the parameters:
http://www.php.net/manual/en/function.setcookie.php
-Shane
----- Original Message -----
From: "phpLover" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 11:25 PM
Subject: [PHP] Session With Cookies
> How can I maintain a user session using cookies?
>
> Thanks
>
>
>
> --
> 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]
--
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]