From 168680976f9678e2769b77324e8a80527c16d287 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 2 Apr 2013 13:58:08 +0400 Subject: [PATCH] sessions: initialize connection on include, not in ttrss_open --- include/sessions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/sessions.php b/include/sessions.php index dd1ca663d..4923a05b7 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -19,6 +19,10 @@ ini_set("session.use_only_cookies", true); ini_set("session.gc_maxlifetime", $session_expire); + global $session_connection; + + $session_connection = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + function session_get_schema_version($link, $nocache = false) { global $schema_version; @@ -34,6 +38,7 @@ function validate_session($link) { if (SINGLE_USER_MODE) return true; + if (!$link) return false; $check_ip = $_SESSION['ip_address']; @@ -95,8 +100,6 @@ global $session_connection; - $session_connection = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - return true; }