How to set a value in session ?
$_SESSION['name'] = 'value';
session_start sends header information to the client, so call it before outputting anything.
Try out with the below example code:
/ set the session name to WebsitePHP /
$previous_name = session_name("WebsitePHP");
echo "The previous session name was $previous_name<br />";
Hope this helps.