@@ -20,9 +20,9 @@ class Session
20
20
use Nette \SmartObject;
21
21
22
22
/** Default file lifetime */
23
- private const DEFAULT_FILE_LIFETIME = 3 * Nette \Utils \DateTime::HOUR ;
23
+ private const DefaultFileLifetime = 3 * Nette \Utils \DateTime::HOUR ;
24
24
25
- private const SECURITY_OPTIONS = [
25
+ private const SecurityOptions = [
26
26
'referer_check ' => '' , // must be disabled because PHP implementation is invalid
27
27
'use_cookies ' => 1 , // must be enabled to prevent Session Hijacking and Fixation
28
28
'use_only_cookies ' => 1 , // must be enabled to prevent Session Fixation
@@ -47,7 +47,7 @@ class Session
47
47
private $ options = [
48
48
'cookie_samesite ' => IResponse::SAME_SITE_LAX ,
49
49
'cookie_lifetime ' => 0 , // for a maximum of 3 hours or until the browser is closed
50
- 'gc_maxlifetime ' => self ::DEFAULT_FILE_LIFETIME , // 3 hours
50
+ 'gc_maxlifetime ' => self ::DefaultFileLifetime , // 3 hours
51
51
];
52
52
53
53
/** @var IRequest */
@@ -93,14 +93,14 @@ private function doStart($mustExists = false): void
93
93
{
94
94
if (session_status () === PHP_SESSION_ACTIVE ) { // adapt an existing session
95
95
if (!$ this ->started ) {
96
- $ this ->configure (self ::SECURITY_OPTIONS );
96
+ $ this ->configure (self ::SecurityOptions );
97
97
$ this ->initialize ();
98
98
}
99
99
100
100
return ;
101
101
}
102
102
103
- $ this ->configure (self ::SECURITY_OPTIONS + $ this ->options );
103
+ $ this ->configure (self ::SecurityOptions + $ this ->options );
104
104
105
105
if (!session_id ()) { // session is started for first time
106
106
$ id = $ this ->request ->getCookie (session_name ());
@@ -500,7 +500,7 @@ public function setExpiration(?string $time)
500
500
{
501
501
if ($ time === null ) {
502
502
return $ this ->setOptions ([
503
- 'gc_maxlifetime ' => self ::DEFAULT_FILE_LIFETIME ,
503
+ 'gc_maxlifetime ' => self ::DefaultFileLifetime ,
504
504
'cookie_lifetime ' => 0 ,
505
505
]);
506
506
0 commit comments