]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Session cookie setting being set while session is active 1406/head
authorArthurHoaro <arthur@hoa.ro>
Thu, 23 Jan 2020 18:51:14 +0000 (19:51 +0100)
committerArthurHoaro <arthur@hoa.ro>
Thu, 23 Jan 2020 18:51:14 +0000 (19:51 +0100)
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

index.php

index a39fc762e23aaa0c9a7212e049adc7ef4c0c91eb..6a82d571a6a22e7e9c5f84c0f193cbcd08d569a2 100644 (file)
--- 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: