From: ArthurHoaro Date: Thu, 23 Jan 2020 18:51:14 +0000 (+0100) Subject: Session cookie setting being set while session is active X-Git-Tag: v0.12.0-beta~18^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=09390a50cdc168197a5b1362c0c50ee5d5da400b;p=github%2Fshaarli%2FShaarli.git Session cookie setting being set while session is active Trying to do will raise a warning since PHP 7.2, and it never worked as intented. See: https://bugs.php.net/bug.php\?id\=75650 --- diff --git a/index.php b/index.php index a39fc762..6a82d571 100644 --- a/index.php +++ b/index.php @@ -243,7 +243,9 @@ if (isset($_POST['login'])) { } // Send cookie with the new expiration date to the browser + session_destroy(); session_set_cookie_params($expirationTime, $cookiedir, $_SERVER['SERVER_NAME']); + session_start(); session_regenerate_id(true); // Optional redirect after login: