note 28379 added to function.setcookie

From: Date: Sat, 11 Jan 2003 02:35:30 +0000
Subject: note 28379 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-41982@lists.php.net to get a copy of this message
It sounds like you need to set the expiration date for the cookie. Try this: setcookie("tekka_p","HOWDY_DOO",time() + 86400); This would set the cookie's expiration date to one day from the time it is set. If you have the time period for the cookie declared in a variable make sure that it is valid for the current scope. I had time()+$cookie_period but $cookie_period was Null in that scope so my cookies were set and then immediately vanished. Those cookies did not taste good at all. Kinda Cement + Chocolate Chip. Icky. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+28379 http://master.php.net/manage/user-notes.php?action=delete+28379 http://master.php.net/manage/user-notes.php?action=reject+28379

« previous php.notes (#41982) next »