note 15179 deleted from function.setcookie by vincent

From: Date: Wed, 10 Sep 2003 18:37:20 +0000
Subject: note 15179 deleted from function.setcookie by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55966@lists.php.net to get a copy of this message
Note Submitter: agx@REMOVE.icicampus.it ---- 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 )

« previous php.notes (#55966) next »