jimfrith
asked on
PHP session only works after a refresh
I am using sessions with multiple php pages. The session variables do not work until The second time I view the page (i.e. refresh)
I tried a simple version of sessions and had the same results.
<?PHP
session_start();
$_SESSION ["var"] = "val";
echo $var;
echo $PHPSESSID;
?>
the echo for both the $var and the $PHPSESSID do not show up until I refresh the page. How do I use sessions without refreshing?
I tried a simple version of sessions and had the same results.
<?PHP
session_start();
$_SESSION ["var"] = "val";
echo $var;
echo $PHPSESSID;
?>
the echo for both the $var and the $PHPSESSID do not show up until I refresh the page. How do I use sessions without refreshing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and put your opening <?php tag in the right place ;)