Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix salesagility#10249 and salesagility/SuiteCRM-Core#447

Adds required `samesite` parameter to `SugarApplication::setCookie()`
  • Loading branch information
chris001 committed Mar 8, 2024
1 parent 8735575 commit c041749
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/MVC/SugarApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,8 @@ public static function setCookie(
$path = null,
$domain = null,
$secure = false,
$httponly = true
$httponly = true,
$samesite = "Strict"
) {
if (isSSL()) {
$secure = true;
Expand All @@ -812,7 +813,8 @@ public static function setCookie(
}

if (!headers_sent()) {
setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
setcookie($name, $value, ["expire" => $expire, "path" => $path, "domain"=>$domain,
"secure"=>$secure, "httponly"=>$httponly, "samesite"=>$samesite]);
}

$_COOKIE[$name] = $value;
Expand Down

0 comments on commit c041749

Please sign in to comment.