]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Update session start condition 1236/head
authorBish Erbas <42714627+bisherbas@users.noreply.github.com>
Wed, 31 Oct 2018 13:09:35 +0000 (09:09 -0400)
committerGitHub <noreply@github.com>
Wed, 31 Oct 2018 13:09:35 +0000 (09:09 -0400)
Recommended method for PHP >= 5.4.0 as seen here https://stackoverflow.com/questions/6249707/check-if-php-session-has-already-started

Per https://shaarli.readthedocs.io/en/master/Server-configuration/ Shaarli supports PHP >= 5.6

index.php

index b702bd133bc7023c7f9c5d63396754a80f272d51..82285dd94ec896c8b5874e2146f151b27e8fda61 100644 (file)
--- a/index.php
+++ b/index.php
@@ -111,7 +111,7 @@ ini_set('session.use_trans_sid', false);
 
 session_name('shaarli');
 // Start session if needed (Some server auto-start sessions).
-if (session_id() == '') {
+if (session_status() == PHP_SESSION_NONE) {
     session_start();
 }