Re: coockie expiration problems

From: Date: Mon, 02 Sep 2002 11:07:27 +0000
Subject: Re: coockie expiration problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-114902@lists.php.net to get a copy of this message
Hi, I see really nothing wrong in your example. Did you tried to verify with isset() if the cookie is still here or not? And well, you should use double quote on setcookie("referrer", $user_id, time()+10); You call should be also $_COOKIE['referrer'] and not $_COOKIE[referrer]. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas nicos@worldakt.com nicos@php.net www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet "Andy" <news.letters@gmx.de> a écrit dans le message de news: 20020902105136.94808.qmail@pb1.pair.com... > Hi there, > > I am trying to save a var inside a cookie for a certain time (in this > example 10s): > setcookie('referrer', $user_id, time()+10); //expires in one hour > > Now I would like to get the value, but only if the coockie is valid (if > cockie not older than 10 s in this example) > echo 'referrer: '.$_COOKIE[referrer]; > > Unfortunatelly this does not work, the cockie value is always valid, even > after expiration time. > > What am I doing wrong? > > Thanx for any help on that, > > Andy > >

« previous php.general (#114902) next »