Problem loging out in local domain
Posted: Fri Jul 11, 2008 4:02 am
I had a problem with the logout action deleting cookies on a local domain like localhost. (One without a dot)
I found that the serendipity_deleteCookie function was missing the same condition for local domains that the serendipity_setCookie has. (In functions_config.inc.php)
The cookies have to be deleted with sam host value as they were set, so for lacal domains, they cannot be deleted.
Adding the following lines after line 649 in the serendipity_deleteCookie function fixes the problem:
// If HTTP-Hosts like "localhost" are used, current browsers reject cookies.
// In this case, we disregard the HTTP host to be able to delete that cookie.
if (substr_count($host, '.') < 2) {
$host = '';
I found that the serendipity_deleteCookie function was missing the same condition for local domains that the serendipity_setCookie has. (In functions_config.inc.php)
The cookies have to be deleted with sam host value as they were set, so for lacal domains, they cannot be deleted.
Adding the following lines after line 649 in the serendipity_deleteCookie function fixes the problem:
// If HTTP-Hosts like "localhost" are used, current browsers reject cookies.
// In this case, we disregard the HTTP host to be able to delete that cookie.
if (substr_count($host, '.') < 2) {
$host = '';