I've got an issue, I've looked everywhere and can't find an answer. On one of my pages I have it set so users can change there firstname/lastname etc, once the change is done, they can't see there firstname change, the only way they can at the moment is to logout then login again. I've tried session refresh, but that doesn't help, although it does change the session ID. If someone could link me a tutorial or even post a snippet of code that does that, it would be great! Thank you. My current script for displaying the user's data is via session.
<?php
error_reporting(E_ERROR);
?>
<?php
session_start();
if(!isset($_SESSION["user"]) or !is_array($_SESSION["user"]) or
empty($_SESSION["user"])
)
// redirect to index page if not superuser
header('Location: index.php');
mkdir('users/'.$_SESSION["user"]["id"])
?>
<?php
$old_sessionid = session_id();
session_regenerate_id();
$new_sessionid = session_id();
echo "Old Session: $old_sessionid<br />";
echo "New Session: $new_sessionid<br />";
print_r($_SESSION);
?>
<h3 align="left"><?= $_SESSION["user"]["firstname"] ?></h3>
<h3 align="left"><?= $_SESSION["user"]["id"] ?></h3>
</div>