note 15179 modified in function.setcookie by philip
| From: | philip@php.net | Date: | Tue, 21 Jan 2003 21:38:13 +0000 |
| Subject: | note 15179 modified in function.setcookie by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-42540@lists.php.net to get a copy of this message | ||
Set a cookie and redirect using:
$url = $_SERVER['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 )
--was--
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