I wrote a simple php(html) script to show me a status. Via JQUERY the status update happen automatically. A few parameters are provided from another script and sent via GET
to the status script.
So the idea was to use S_SESSION
if( session_status() == PHP_SESSION_NONE ) // if session status is none then start the session
{
session_start();
$_SESSION['dur'] = 10;
$_SESSION['gDur'] = 0;
}else{
error_log("ShowListeners Session: " . var_export($_SESSION, true),0);
}
if(isset($_GET['dur'])){
error_log("ShowListeners GET: " . var_export($_GET, true) , 0);
$_SESSION['dur'] = $_GET['dur'];
$_SESSION['gDur'] = $_GET['gDur'];
}
In the part where I try to read the session data
if(isset($_SESSION['dur']))
$ret .= getTimeString($_SESSION['dur']);
$_SESSION['dur']
is always not existing. I also can see, that every time the script is called, session_start()
is called because I can not see any error_log!
Do I something wrong or is it not possible to store the data in a session variable?
Edit(2021-08-08)
In the meantime I have read a lot about SESSION
. I understand, that SESSION
are related to users or cookies. But what is not clear to me, is there any possibility to make sure, that several instances can access the same SESSION
data? For example, there is a instance running and another instance get over GET
an data update. Can this instance access and modify the SESSION
date used by the first instance?