Skip to content

Commit 1ca59bf

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Http Foundation] Fix clear cookie samesite [Security] Check if firewall is stateless before checking for session/previous session [Form] Support customized intl php.ini settings [Security] Remember me: allow to set the samesite cookie flag [Debug] fix for PHP 7.3.16+/7.4.4+ [Validator] Backport translations [Mailer] Use %d instead of %s for error code in error messages [HttpKernel] fix locking for PHP 7.4+ [Security] Fixed hardcoded value of SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE Prevent warning in proc_open() [FrameworkBundle] Fix Router Cache Fix deprecation messages
2 parents c7c8110 + dcf596a commit 1ca59bf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

RememberMe/AbstractRememberMeServices.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
3939
protected $options = [
4040
'secure' => false,
4141
'httponly' => true,
42+
'samesite' => null,
4243
];
4344
private $providerKey;
4445
private $secret;
@@ -274,7 +275,7 @@ protected function cancelCookie(Request $request)
274275
$this->logger->debug('Clearing remember-me cookie.', ['name' => $this->options['name']]);
275276
}
276277

277-
$request->attributes->set(self::COOKIE_ATTR_NAME, new Cookie($this->options['name'], null, 1, $this->options['path'], $this->options['domain'], $this->options['secure'] ?? $request->isSecure(), $this->options['httponly'], false, $this->options['samesite'] ?? null));
278+
$request->attributes->set(self::COOKIE_ATTR_NAME, new Cookie($this->options['name'], null, 1, $this->options['path'], $this->options['domain'], $this->options['secure'] ?? $request->isSecure(), $this->options['httponly'], false, $this->options['samesite']));
278279
}
279280

280281
/**

RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
8686
$this->options['secure'] ?? $request->isSecure(),
8787
$this->options['httponly'],
8888
false,
89-
$this->options['samesite'] ?? null
89+
$this->options['samesite']
9090
)
9191
);
9292

@@ -121,7 +121,7 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
121121
$this->options['secure'] ?? $request->isSecure(),
122122
$this->options['httponly'],
123123
false,
124-
$this->options['samesite'] ?? null
124+
$this->options['samesite']
125125
)
126126
);
127127
}

RememberMe/TokenBasedRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
8383
$this->options['secure'] ?? $request->isSecure(),
8484
$this->options['httponly'],
8585
false,
86-
$this->options['samesite'] ?? null
86+
$this->options['samesite']
8787
)
8888
);
8989
}

0 commit comments

Comments
 (0)