sessions: properly check for cookie being set

This commit is contained in:
Andrew Dolgov 2013-03-28 12:40:56 +04:00
parent 2751718009
commit 2137d67496
1 changed files with 2 additions and 4 deletions

View File

@ -103,14 +103,12 @@
} }
if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') { if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') {
if ($_COOKIE[$session_name]) { if (isset($_COOKIE[$session_name])) {
@session_start(); @session_start();
if (!$_SESSION["uid"]) { if (!$_SESSION["uid"]) {
session_destroy(); session_destroy();
if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/');
setcookie(session_name(), '', time()-42000, '/');
}
} }
} }
} }