fix cookie removal to use proper host
This commit is contained in:
parent
68b684c1bb
commit
bcc47f6f3a
@ -3,6 +3,9 @@
|
||||
Version 1.4 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Make cookie deletion routine use the same host like cookie
|
||||
insertion, thanks to JPhilip
|
||||
|
||||
* Added optional token insertion for comment notification
|
||||
(moderation) e-mails, which you can click without the need
|
||||
for authentication. This is a convenience feature, note that
|
||||
|
@ -620,7 +620,7 @@ function serendipity_setCookie($name, $value, $securebyprot = true) {
|
||||
|
||||
// If HTTP-Hosts like "localhost" are used, current browsers reject cookies.
|
||||
// In this case, we disregard the HTTP host to be able to set that cookie.
|
||||
if (substr_count($host, '.') < 2) {
|
||||
if (substr_count($host, '.') < 1) {
|
||||
$host = '';
|
||||
}
|
||||
|
||||
@ -646,6 +646,12 @@ function serendipity_deleteCookie($name) {
|
||||
$host = substr($host, 0, $pos);
|
||||
}
|
||||
|
||||
// If HTTP-Hosts like "localhost" are used, current browsers reject cookies.
|
||||
// In this case, we disregard the HTTP host to be able to set that cookie.
|
||||
if (substr_count($host, '.') < 1) {
|
||||
$host = '';
|
||||
}
|
||||
|
||||
setcookie("serendipity[$name]", '', time()-4000, $serendipity['serendipityHTTPPath'], $host);
|
||||
unset($_COOKIE[$name]);
|
||||
unset($serendipity['COOKIE'][$name]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user