3
I’m having trouble checking if there’s anything within the session. The functions I’m using are: Function to check if you have someone logged in
if(usuarioestalogado()){?>
<p class="alert-success">Você está logado como: <?= usuariologado() ?></p>
else...
Ancillary functions
session_start();
function logausuario($email){
$_SESSION["usuario_logado"] = $email;
}
function usuarioestalogado()
{
return (isset($_SESSION["usuario_logado"]));
}
Entertaining he never enters the if only in the Else and by looking at cookies, Siession is present at:
Does anyone have any idea why this occurs?
These functions are in a different if file?
– rray
var_dump($_SESSION)
returns what?– André Ribeiro
@rray are yes.
– Rodolfo Oliveira
@Andréribeiro returns array(1) { ["usuario_logado"]=> NULL } array(1) { ["usuario_logado"]=> NULL }
– Rodolfo Oliveira
@Rodolfooliveira Very strange. Take another test:
var_dump($_SESSION, isset($_SESSION["usuario_logado"]))
– André Ribeiro
Got to show a little more code?
– Skywalker