I'm registering a variable on my login page and redirecting the browser to a new page. On that new page I placed session_start() before any HTML. I then check the value of my session variable and the value I set is gone. When I check the temp folder to look at the session files, two files were created, the first one has the value in it and the second is blank. Why are two files being created? Is there possible something I need to change in the INI file?
Here is a snippet of what I'm trying to do:
(login.php)
<?php
//SET THE VALUES FOR TESTING PURPOSES
session_start();
if (! isset($loggin)) {
session_register("loggin"
$loggin = true;
?><script>
location.replace('page2.php');
</script>
<?php
}
?>
//%%%%%%%%%%%%%%%%%%%%%%%%
(page2.php)
<?php
session_start();
echo "The value is: " . $loggin;
?>
Any help would be great! Thanks!
Here is a snippet of what I'm trying to do:
(login.php)
<?php
//SET THE VALUES FOR TESTING PURPOSES
session_start();
if (! isset($loggin)) {
session_register("loggin"
$loggin = true;
?><script>
location.replace('page2.php');
</script>
<?php
}
?>
//%%%%%%%%%%%%%%%%%%%%%%%%
(page2.php)
<?php
session_start();
echo "The value is: " . $loggin;
?>
Any help would be great! Thanks!