hello im taking variables from $_POST and stores them in Sessions but i cant figure out why my program creates two files per $_POST och empty and one with my variables.
session_start();
session_regenerate_id();
$_SESSION['S_LocalIP'] = $_POST['LocalIP'];
$_SESSION['S_Computername'] = $_POST['Computername'];
$_SESSION['S_GUID'] = $_POST['GUID'];
$_SESSION['S_BaseAddress'] = $_POST['BaseAddress'];
var_dump($_POST);
session_write_close();
everything works like i want except i get the one empty session file aswell.
The problem is that you use
session_regenerate_id(), usesession_regenerate_id(true)instead to remove the old id.The first parameter for this function is
$delete_old_sessionwhich by default is set tofalse.