note 27169 added to function.setcookie

From: Date: Mon, 25 Nov 2002 22:16:14 +0000
Subject: note 27169 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-39965@lists.php.net to get a copy of this message
Another way, to set cookie without SetCookie() function. <?php //Time in seconds - cookie long. $howlong=3600*24*31; //Name of the cookie. $cookiename="name"; //Value of the cookie. $cookievalue="value"; $cookieexpires=date("l, d-M-Y H:i:s",time()+$howlong); header("Set-Cookie: {$cookiename}={$cookievalue}; expires={$cookieexpires} GMT; path=/;"); ?> Greetings from Russia. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+27169 http://master.php.net/manage/user-notes.php?action=delete+27169 http://master.php.net/manage/user-notes.php?action=reject+27169

« previous php.notes (#39965) next »