Added more protection against session theft
This commit is contained in:
parent
8db64004ca
commit
243e9b045f
3 changed files with 14 additions and 1 deletions
|
|
@ -35,6 +35,11 @@ if (password_verify($input->password, $password)) {
|
|||
|
||||
$_SESSION['id'] = $id;
|
||||
$_SESSION['type'] = $type;
|
||||
|
||||
$randomSecret = base64_encode(openssl_random_pseudo_bytes(32));
|
||||
$_SESSION['secret'] = $randomSecret;
|
||||
|
||||
setcookie("authSecret", $randomSecret, 0, "/", "", false, true);
|
||||
} else {
|
||||
$retval['status'] = "fail";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue