I have an issue with sessions and created the following code to demonstrate. In the following example, I would expect the Old and New Count to increment each time the screen was refreshed, but they don't. It seems that the $_Session variables are reset each time.
Any Thoughts?
Alan Arons
Any Thoughts?
Alan Arons
Code:
<?php
session_start();
if ( ! isset( $_SESSION))
{
echo "Session was not set";
exit ;
}
else
{
$oldcount=$_SESSION['count'];
echo "Old count is ".$oldcount." <br />";
$_SESSION['count']++ ;
}
echo "New count is ",$_SESSION['count'],". <br />";
echo "The session id is: ",session_id();
?>