note 72180 modified in function.setcookie by danbrown

From: Date: Sun, 17 May 2009 17:55:03 +0000
Subject: note 72180 modified in function.setcookie by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155038@lists.php.net to get a copy of this message
If you ever find yourself in a situation where you need to overwrite a non-PHP application's session cookie, you can do that with the following line: <?php header("Set-Cookie: SIDNAME=$overwrite; path=/; secure"); ?> I couldn't get setcookie() to do this for all major web browsers, but manually sending the header did the trick. Note: Remove secure if you aren't mandating SSL connections. --was-- If you ever find yourself in a situation where you need to overwrite a non-PHP application's session cookie, you can do that with the following line: header("Set-Cookie: SIDNAME=$overwrite; path=/; secure"); I couldn't get setcookie() to do this for all major web browsers, but manually sending the header did the trick. Note: Remove secure if you aren't mandating SSL connections. http://php.net/manual/en/function.setcookie.php

« previous php.notes (#155038) next »