I'm new to PHP and I learn sessions right now, so I tried to to create two files, one that creates the session var and one who prints it.. here's the code: session1.php
<?php session_start(); $_SESSION['a'] = 1; echo 'The session right now is: ' . $_SESSION['a']; ?>
session2.php
<?php
session_start();
if(isset($_SESSION['a']))
{
echo $_SESSION['a'];
}
else
{
echo 'but the output here is false';
}
?>
First I enter to session1.php to create the session, then I go to session2.php and the output is false.. This only happens when this files are uploaded to the web hosting, you are welcome to try it yourself in this url: wwww.pzwhatsup.com/session1.php and wwww.pzwhatsup.com/session2.php. When trying this in my computer with wamp, it works perfectly..