Added more protection against session theft

This commit is contained in:
Lukas Metzger 2016-01-29 15:39:40 +01:00
commit 243e9b045f
3 changed files with 14 additions and 1 deletions

View file

@ -18,7 +18,14 @@
session_start();
if(!isset($_SESSION['id'])) {
if(
!isset($_SESSION['id']) ||
!isset($_SESSION['secret']) ||
!isset($_COOKIE['authSecret']) ||
$_SESSION['secret'] !== $_COOKIE['authSecret']
) {
header('Location: index.php');
session_destroy();
exit();
}