I am facing a very strange problem in PHP sessions, here are the facts:
Creating session variable code - mydomain / a / b / c / create_session.php
<? session_start(); $_SESSION['test'] = "Hello World"; ?>
Reading the session variable read mydomain / a / b / c / read_session.php
<? session_start(); echo $_SESSION['test']; ?>
Problem
When I access read_session.php code from the same URL, it works fine. But when I try to read the session variable from another path, it does not work.
<strong> Examples
mydomain / a / b / c / read_session.php - works!
mydomain / a / b / read_session.php - works!
mydomain / a / read_session.php - works!
mydomain / read_session.php - does not work!
mydomain / d / read_session.php - does not work!
source share