note 15179 added to function.setcookie
| From: | agx at REMOVE dot icicampus dot it | Date: | Thu, 30 Aug 2001 15:38:08 +0000 |
| Subject: | note 15179 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17390@lists.php.net to get a copy of this message | ||
Set a cookie and redirect using:
$url = $REQUEST_URI;
if ( strpos( $url, '?') == false ) {
$url .= '?setcookie=1';
} else {
$url .= '&setcookie=1';
}
Header('Location: '. $url);
If your cookie is empty and setcookie==1 then the browser does not supports cookies (i have plenty
of robots visiting my site and do not wanna a create a new session on each page they visit :-P )
http://www.php.net/manual/en/function.setcookie.php