I’m having some issues with session for some reason. I’ve never had issues with sessions, up until now. I have three pages:
/index.php
/test/sessions.php
/test/sessions2.php
All of which have the same code(/test/sessions.php also sets a session value):
<?php
if(!isset($_SESSION)){
session_start();
}
var_dump($_SESSION);
echo(session_id());
?>
session.php(setting value):
<?php
session_start();
$_SESSION['foo'] = 'bar';
?>
The code works fine on the pages in the /test/ directory, but not on the index page. When I navigate to the index page it will clear all session data, but like I said, noting is wrong with the pages in the /text/ directory. Am I missing something?
Your session cookie path seems to be
/test.or./. Setting it to/would fix this probably.