I changed my session_register
to $_SESSION
, however $_SESSION
does not allow me to use the variable in the same way as session_register
.
For being deprecated I thought they corresponded the same thing. However the use after the declaration is very different, session variables generated by the session_register can be used normally, deplacaras by $ _SESSION not.
$nome = "Haxz";
session_register("nome");
After the declaration, simply using $nome
it already returns the value. As a common variable.
$_SESSION["nome"] = "Haxz";
It does not allow me to use the variable as $nome
, only as $_SESSION["nome"]
.
What intrigues me is that both can be tested in the same way isset($_SESSION["nome"])
and in print_r($_SESSION)
, are shown equal.
I do not want to change my entire project (it's pretty big)
How do $_SESSION["nome"]
respond equal to session_register("nome")
?
(respond in the sense that you can work with it only with a $nome
matching variable.)