The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Session Confusion Reply To: Session Confusion


I think I’ve got it. I’ve removed all the requests and did some other tweaks and the username is now displayed in the welcome message. This is how I have set the session :

$_SESSION['UserName'] = $UserName;
$message = "Welcome ".$UserName."

I’ve tested the session using :

 Print_r ($_SESSION);

I can now use that session in every page provided I add session_start(); ?

Also do I need session_start(); on the page in which I first create the session?