Skip to content

Commit 001324d

Browse files
committed
Add Samsite Cookie attribute
1 parent 59948eb commit 001324d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@
6464
$_SESSION['login'] = TRUE;
6565
$_SESSION["csfrToken"] = hash('sha256', random_bytes(20));
6666
if(isset($_POST['stayloggedin'])){
67-
setcookie("Login", $passToken, time()+2592000, "","",FALSE, TRUE);
67+
setcookie("Login", $passToken, [
68+
'expires' => time() + 2592000,
69+
'path' => '*',
70+
'secure' => FALSE,
71+
'httponly' => TRUE,
72+
'samesite' => 'Strict',
73+
]);
6874
}
6975

7076
// Not logged in or invalid data

0 commit comments

Comments
 (0)