summaryrefslogtreecommitdiff
path: root/include/sessions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/sessions.php')
-rw-r--r--include/sessions.php20
1 files changed, 3 insertions, 17 deletions
diff --git a/include/sessions.php b/include/sessions.php
index d4f21d8cd..891a6b3fa 100644
--- a/include/sessions.php
+++ b/include/sessions.php
@@ -19,25 +19,10 @@
ini_set("session.gc_maxlifetime", $session_expire);
ini_set("session.cookie_lifetime", "0");
- function session_get_schema_version() {
- global $schema_version;
-
- if (!$schema_version) {
- $row = \Db::pdo()->query("SELECT schema_version FROM ttrss_version")->fetch();
-
- $version = $row["schema_version"];
-
- $schema_version = $version;
- return $version;
- } else {
- return $schema_version;
- }
- }
-
function validate_session() {
if (\Config::get(\Config::SINGLE_USER_MODE)) return true;
- if (isset($_SESSION["ref_schema_version"]) && $_SESSION["ref_schema_version"] != session_get_schema_version()) {
+ if (isset($_SESSION["ref_schema_version"]) && $_SESSION["ref_schema_version"] != \Config::get_schema_version()) {
$_SESSION["login_error_msg"] =
__("Session failed to validate (schema version changed)");
return false;
@@ -152,6 +137,7 @@
if (!defined('NO_SESSION_AUTOSTART')) {
if (isset($_COOKIE[session_name()])) {
- @session_start();
+ if (session_status() != PHP_SESSION_ACTIVE)
+ session_start();
}
}