How do I fix this problem with $_SESSION variables?
Session variables are present when I am on http://www.example.com
, and run this code:
echo 'Printing session variables: <br><br><pre>';
foreach ($_SESSION as $key=>$val)
echo $key. ": ".$val. "<br>";
echo '</pre>';
However, if I am on http://example.com
, there are no session variables.
How can I make it so that $_SESSIONs work the same, regardless whether www.
is prefixed or not?
I would like the site to default to http://example.com
, not to http://www.example.com