OK, I found the reason, but not the solution yet: The cookie time during setting is the time taken from the server. The time for checking the coockie is the time of the local machine!!
So what can I do if I would like to last the coockie for 1 hour and the person is sitting on the other site of the world running 10 hours time difference? Puhh.. maybe I am wrong, but this is how it seems to be. Any ideas? Andy <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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 > [EMAIL PROTECTED] > [EMAIL PROTECTED] > www.GroupAKT.com - Hébergement Group. > www.WorldAKT.com - Hébergement de sites Internet > "Andy" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > 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 > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php