I want to store a global variable that exist as long as the application is running and accessible from all the sessions. I tried $GLOBALS but it's not durable. It's temporary, I store the data and when I request the same code again, it says that this index not recognised.
Will I have to store my value in a file?
Edit :: this is a sample code that always print 'not set'
if(isset($GLOBALS['myindex']){
echo 'set';
echo $GLOBALS['myindex'];
}else{
echo 'not set';
$GLOBALS['myindex']='myValue';
}