Every time I change page or refresh the page I lose all my sessions variables, after while I figured out it was caused by the session id that changes everytime (I think it is because of this). Something strange, is that for a day the session id stopped changing and it worked and then again, it doesn’t work anymore.
Here is my config session file :
<?php
ini_set("session.use_only_cookies", 1);
ini_set("session.use_strict_mode", 1);
session_set_cookie_params([
"lifetime" => 1800,
"domain" => "localhost",
"path" => "/", // session marche partout
"secure" => true, // marche seulement avec une connexion https
"httponly" => true, // l'utilisateur ne puisse pas changer les cookies avec un script de hack
]);
session_start();