Code: Select all
$_SESSION['log'] = array(
"email" => $email,
"password" => $password,
...
);
Code: Select all
if ($_SESSION['log'])
{
//user is logged in
}
Thanks for reading.
Moderator: General Moderators
Code: Select all
$_SESSION['log'] = array(
"email" => $email,
"password" => $password,
...
);
Code: Select all
if ($_SESSION['log'])
{
//user is logged in
}
I'm not so sure I know what you mean by convention. Do you mean check if $_SESSION['email'] is set instead of $_SESSION['login']?tasairis wrote:It doesn't matter. And you can put whatever you want into $_SESSION.
You don't need a variable just to keep track if the user is logged in. Create a convention: if there is an [email] then the user logged in successfully, otherwise they did not.