Last active
July 12, 2017 00:40
-
-
Save lucas-marciano/c5c1b55341b8ce1789743ade3a01d08e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/*Codigo original*/ | |
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { | |
header("Location: http://www.google.com"); | |
exit(); | |
} elseif (isset($_COOKIE['Loggedin']) && $_COOKIE['Loggedin'] == true) { | |
header("Location: http://www.google.com"); | |
exit(); | |
} | |
?> | |
<?php | |
/*Codigo refatorado*/ | |
if ((isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) || | |
isset($_COOKIE['Loggedin']) && $_COOKIE['Loggedin'] == true) { | |
header("Location: http://www.google.com"); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment