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