mirror of
https://github.com/jakejarvis/spoons.git
synced 2026-10-01 19:25:39 -04:00
fix security flaw -- still prints list after redirect to login page
This commit is contained in:
1 parent
1855f77493
commit
0f3d8f7b4c
2 files changed
+4
No files matched your search
@@ -4,6 +4,7 @@ include_once('config.php');
|
||||
session_start();
|
||||
if(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] == FALSE) {
|
||||
header("Location:" . $site_url . "/login");
|
||||
die();
|
||||
}
|
||||
|
||||
include_once('functions.php');
|
||||
|
||||
@@ -5,9 +5,11 @@ session_start();
|
||||
|
||||
if($_SESSION['logged_in']) {
|
||||
header("Location:" . $site_url . "/");
|
||||
die();
|
||||
} else if($_COOKIE['remembered'] == 'TRUE') {
|
||||
$_SESSION['logged_in'] = TRUE;
|
||||
header("Location:" . $site_url . "/");
|
||||
die();
|
||||
}
|
||||
|
||||
if(isset($_POST['password'])) {
|
||||
@@ -18,6 +20,7 @@ if(isset($_POST['password'])) {
|
||||
setcookie('remembered', 'TRUE', $threeMonths);
|
||||
}
|
||||
header("Location:" . $site_url . "/");
|
||||
die();
|
||||
} else {
|
||||
$failure = TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user