$cookie error
| From: | Sukanto Kho | Date: | Thu, 01 Jul 2004 02:58:10 +0000 |
| Subject: | $cookie error | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35069@lists.php.net to get a copy of this message | ||
Hi All,
I'm using $_session to store user name and status
and the session is used as key to access some pages
and I set the cookie variables like this :
setcookie ("name",$user_name, $time+3600);
setcookie ("status",$status, $time+3600);
and the authentication of the session variable like this :
if(!isset($_COOKIE['name']) or !isset($_COOKIE['status']) or
$_COOKIE['status']!='user')
{header("location:sign_in.php");exit;}
else
{$user_active=$_COOKIE['name'];$status=$_COOKIE['status'];}
But the problem is that sometimes when I link to (eg : product_add.php require $_session) it success
but in the other time it's fail ...(although I do it continuous ...I mean after the 1st time
success and 2nd times fail)...
it couldn't be the problem of $_session lifetime ... I think.
I can't find "why" such problem occurs....
anyone hav the same problem??
thanx anyway... Flame (sorry if out of topic)...