i am saving a value to be called later by other classes because I need this value and can't save it to a cookie because its needs a page refresh and can't make the value global for some reason. It sets the value but will not return it and can't work out why.
class security{
static function auth_key($request, $data=false){
if($request=="set"){
//this is always set first and works.
$auth_key_value=$data;
}
if($request=="get"){
//If i try die("test"); here is does not die, so its like it does not call it.
return $auth_key_value;
}
}
}
and the call
echo $key = security::auth_key("get");
This returns nothing, what am I doing wrong?