function SessionTestCase::testSameSiteCookieAttributeStrict
Test SameSite attribute = Strict on session cookies.
File
-
modules/
simpletest/ tests/ session.test, line 382
Class
- SessionTestCase
- @file Provides SimpleTests for core session handling functionality.
Code
function testSameSiteCookieAttributeStrict() {
variable_set('samesite_cookie_value', 'Strict');
$user = $this->drupalCreateUser(array(
'access content',
));
$this->sessionReset($user->uid);
$this->drupalLogin($user);
$this->assertTrue(preg_match('/SameSite=Strict/i', $this->drupalGetHeader('Set-Cookie', TRUE)), 'Session cookie is set as SameSite=Strict.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.