Skip to content

Commit

Permalink
HttpExtension: option 'sameSiteProtection' does not change session co…
Browse files Browse the repository at this point in the history
…okie flag 'samesite'
  • Loading branch information
dg committed Mar 9, 2019
1 parent f1f8dad commit d9405cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions src/Bridges/HttpDI/HttpExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ public function beforeCompile()
$builder->getDefinitionByType(Nette\Http\Session::class)
->addSetup('setOptions', [['cookie_secure' => $value]]);
}

if (!empty($this->config['sameSiteProtection'])) {
$builder->getDefinitionByType(Nette\Http\Session::class)
->addSetup('setOptions', [['cookie_samesite' => 'Lax']]);
}
}


Expand Down
2 changes: 1 addition & 1 deletion tests/Http.DI/HttpExtension.sameSiteProtection.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Assert::contains(
: 'Set-Cookie: nette-samesite=1; path=/; SameSite=Strict; HttpOnly',
$headers
);
Assert::same('Lax', $container->getService('session.session')->getOptions()['cookie_samesite']);
Assert::true(empty($container->getService('session.session')->getOptions()['cookie_samesite']));

0 comments on commit d9405cc

Please sign in to comment.