Strict samesite cookies

This commit is contained in:
RundelhausCode 2021-03-25 10:28:56 +01:00
parent 3d4e1f1b14
commit 768fdd04bb
1 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,7 @@ use Backend\Models\Group;
use Backend\Models\Password;
session_start();
/**
* @param string $token
* @return Group|null ;
@ -46,6 +47,11 @@ function passwordValidate(string $password1): bool
function makeLogin(string $groupName, int $groupId)
{
setcookie("groupName", $groupName, 0, "/");
setcookie("groupId", $groupId, 0, "/");
$cookieCon = array(
'expires' => 0,
'samesite' => 'Strict',
'path' => '/'
);
setcookie("groupName", $groupName, $cookieCon);
setcookie("groupId", $groupId, $cookieCon);
}