Strict samesite cookies
This commit is contained in:
parent
3d4e1f1b14
commit
768fdd04bb
|
@ -5,6 +5,7 @@ use Backend\Models\Group;
|
||||||
use Backend\Models\Password;
|
use Backend\Models\Password;
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $token
|
* @param string $token
|
||||||
* @return Group|null ;
|
* @return Group|null ;
|
||||||
|
@ -46,6 +47,11 @@ function passwordValidate(string $password1): bool
|
||||||
|
|
||||||
function makeLogin(string $groupName, int $groupId)
|
function makeLogin(string $groupName, int $groupId)
|
||||||
{
|
{
|
||||||
setcookie("groupName", $groupName, 0, "/");
|
$cookieCon = array(
|
||||||
setcookie("groupId", $groupId, 0, "/");
|
'expires' => 0,
|
||||||
|
'samesite' => 'Strict',
|
||||||
|
'path' => '/'
|
||||||
|
);
|
||||||
|
setcookie("groupName", $groupName, $cookieCon);
|
||||||
|
setcookie("groupId", $groupId, $cookieCon);
|
||||||
}
|
}
|
Loading…
Reference in New Issue