New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Undefined property: Config\App::$cookieSameSite #4371
Conversation
Notice: Undefined property: Config\App::$cookieSameSite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need replace $config
to $this
, also you must use property_exists()
if (! in_array(strtolower($this->cookieSameSite), Cookie::ALLOWED_SAMESITE_VALUES, true))
1) CodeIgniter\HTTP\ResponseCookieTest::testCookieBlankSetSameSite CodeIgniter\HTTP\Exceptions\CookieException: The SameSite value must be None, Lax, Strict or a blank string, given.
please add |
There is already a validation check in Cookie for Samesite None without Secure attribute. |
Sorry, what do you mean? |
$config->cookieSameSite = $config->cookieSameSite ?? Cookie::SAMESITE_LAX;
if (property_exists($this, 'cookieSameSite')) {
$this->cookieSameSite = $config->cookieSameSite;
}
if (! in_array(strtolower($config->cookieSameSite), Cookie::ALLOWED_SAMESITE_VALUES, true)) property_exists vs isset:
|
I can't find it in rfc6265 |
@WinterSilence Thanks.
CodeIgniter4/system/HTTP/ResponseTrait.php Lines 102 to 109 in ebdbf0d
|
Description
Fixes the notice.
See https://forum.codeigniter.com/thread-78693.html.
Checklist: