I'm very new to PHP... and have a REST api which sets a session var when a user signs in:
$a = session_id();
if(empty($a)) session_start();
$_SESSION['id']=...
When I call a testFunction in the same browser (anoter tab) the session var is still the same:
$sessionID = session_id();
if(empty($sessionID)) session_start();
echo($_SESSION['id']);
When I Later open an iframe on the page it's still fine.
BUT, when the page inside the iframe reloads to another url, the session is lost...
$_SESSION['id'] // gives error: Undefined index: id
That is, I'm always staying on the same page but my iframe is changing urls.
Am I missunderstanding php session vars? Am I missusing it? Both?