From: Bish Erbas <42714627+bisherbas@users.noreply.github.com> Date: Wed, 31 Oct 2018 13:09:35 +0000 (-0400) Subject: Update session start condition X-Git-Tag: v0.10.3~2^2~5^2 X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=refs%2Fpull%2F1236%2Fhead Update session start condition 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 --- diff --git a/index.php b/index.php index b702bd13..82285dd9 100644 --- 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(); }