File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class Session
3939 // cookies
4040 'cookie_lifetime ' => 0 , // until the browser is closed
4141 'cookie_httponly ' => true , // must be enabled to prevent Session Hijacking
42+ 'cookie_samesite ' => 'Lax ' ,// must be enabled to prevent CSRF
4243
4344 // other
4445 'gc_maxlifetime ' => self ::DEFAULT_FILE_LIFETIME , // 3 hours
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Assert::same([
2525 'use_trans_sid ' => 0 ,
2626 'cookie_lifetime ' => 0 ,
2727 'cookie_httponly ' => true ,
28+ 'cookie_samesite ' => 'Lax ' ,
2829 'gc_maxlifetime ' => 10800 ,
2930 'cookie_path ' => '/user/ ' ,
3031 'cookie_domain ' => 'nette.org ' ,
Original file line number Diff line number Diff line change @@ -15,10 +15,6 @@ if (PHP_SAPI === 'cli') {
1515$ factory = new Nette \Http \RequestFactory ;
1616$ session = new Nette \Http \Session ($ factory ->createHttpRequest (), new Nette \Http \Response );
1717
18- $ session ->setOptions ([
19- 'cookie_samesite ' => 'Lax ' ,
20- ]);
21-
2218$ session ->start ();
2319
2420Assert::contains (
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Assert::same([
2222 'use_trans_sid ' => 0 ,
2323 'cookie_lifetime ' => 0 ,
2424 'cookie_httponly ' => true ,
25+ 'cookie_samesite ' => 'Lax ' ,
2526 'gc_maxlifetime ' => 10800 ,
2627 'cookie_path ' => '/ ' ,
2728 'cookie_domain ' => '' ,
@@ -39,6 +40,7 @@ Assert::same([
3940 'use_trans_sid ' => 0 ,
4041 'cookie_lifetime ' => 0 ,
4142 'cookie_httponly ' => true ,
43+ 'cookie_samesite ' => 'Lax ' ,
4244 'gc_maxlifetime ' => 10800 ,
4345 'cookie_path ' => '/ ' ,
4446 'cookie_secure ' => false ,
@@ -55,6 +57,7 @@ Assert::same([
5557 'use_trans_sid ' => 0 ,
5658 'cookie_lifetime ' => 0 ,
5759 'cookie_httponly ' => true ,
60+ 'cookie_samesite ' => 'Lax ' ,
5861 'gc_maxlifetime ' => 10800 ,
5962 'cookie_path ' => '/ ' ,
6063 'cookie_secure ' => false ,
You can’t perform that action at this time.
0 commit comments