elmas156 Posted September 17, 2008 Share Posted September 17, 2008 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 More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 if you don't use $email and/or $_SESSION['email'], you can remove it safely, yes. Link to comment https://forums.phpfreaks.com/topic/124586-session-logged-question/#findComment-643500 Share on other sites More sharing options...
elmas156 Posted September 17, 2008 Author Share Posted September 17, 2008 I know it would make the code a little sloppy but would it cause any side effects or any problems if I left it in and it's not being used? Link to comment https://forums.phpfreaks.com/topic/124586-session-logged-question/#findComment-643520 Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 Possibly, yes. And it's VERY sloppy and will cause error messages when you turn your error message threshold up. Link to comment https://forums.phpfreaks.com/topic/124586-session-logged-question/#findComment-643522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.