I've been driving myself nuts with this problem.
I'm creating a session id dynamically in order to retain the page state on refresh.
If a page element is clicked, I take the id of the element and pass it to my server side script which creates the session variable:
$_SESSION[$id] = $id;
Bizarrely, this was working only some of the time, I narrowed it down to the fact that some elements have a purely numeric id and others do not:
if (is_numeric($id))
{
$_SESSION[$id] = $id;
$_SESSION['test'] = $id;
}else{
$_SESSION[$id] = $id;
};
In the example above only non-numeric session IDs were visible. For example I could echo $_SESSION['test'];
with no issue at all.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…