Jump to content

Session logged question


elmas156

Recommended Posts

Correct me if I'm wrong but I got some help on here a few weeks ago and I was looking at this code that was suggested to me:

if ($_SESSION['logged'] != 1 || $email == "") { // There was no session found!
$_SESSION['email'] = $email;
echo "<meta http-equiv=\"refresh\" CONTENT=\"0; URL=index.php\">"; // Goes to login page.
exit(); // Stops the rest of the script.

and it doesn't make sense to have the $_SESSION['email'] part in there because if the session isn't logged or set, it wouldn't be able to pass the $email variable through the session anyway, right?  I've been using it on several pages the way it is and it works fine, but isn't this session variable not even not doing anything at all?  I'm a little confused about this so if anyone could make sense of it that would be great.  I don't want to take it out unless I'm sure it's not needed.  Thanks

Link to comment
https://forums.phpfreaks.com/topic/124586-session-logged-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.