@@ -17,15 +17,16 @@ sessions, check their default configuration:
17
17
18
18
# config/packages/framework.yaml
19
19
framework :
20
+ # Enables session support. Note that the session will ONLY be started if you read or write from it.
21
+ # Remove or comment this section to explicitly disable session support.
20
22
session :
21
- # enables the support of sessions in the app
22
- enabled : true
23
- # ID of the service used for session storage.
23
+ # ID of the service used for session storage
24
24
# NULL means that Symfony uses PHP default session mechanism
25
25
handler_id : null
26
26
# improves the security of the cookies used for sessions
27
- cookie_secure : ' auto'
28
- cookie_samesite : ' lax'
27
+ cookie_secure : auto
28
+ cookie_samesite : lax
29
+ storage_factory_id : session.storage.factory.native
29
30
30
31
.. code-block :: xml
31
32
@@ -40,15 +41,16 @@ sessions, check their default configuration:
40
41
41
42
<framework : config >
42
43
<!--
43
- enabled: enables the support of sessions in the app
44
+ Enables session support. Note that the session will ONLY be started if you read or write from it.
45
+ Remove or comment this section to explicitly disable session support.
44
46
handler-id: ID of the service used for session storage
45
47
NULL means that Symfony uses PHP default session mechanism
46
48
cookie-secure and cookie-samesite: improves the security of the cookies used for sessions
47
49
-->
48
- <framework : session enabled =" true"
49
- handler-id =" null"
50
+ <framework : session handler-id =" null"
50
51
cookie-secure =" auto"
51
- cookie-samesite =" lax" />
52
+ cookie-samesite =" lax"
53
+ storage_factory_id =" session.storage.factory.native" />
52
54
</framework : config >
53
55
</container >
54
56
@@ -59,14 +61,16 @@ sessions, check their default configuration:
59
61
60
62
return static function (FrameworkConfig $framework) {
61
63
$framework->session()
62
- // enables the support of sessions in the app
64
+ // Enables session support. Note that the session will ONLY be started if you read or write from it.
65
+ // Remove or comment this section to explicitly disable session support.
63
66
->enabled(true)
64
67
// ID of the service used for session storage
65
68
// NULL means that Symfony uses PHP default session mechanism
66
69
->handlerId(null)
67
70
// improves the security of the cookies used for sessions
68
71
->cookieSecure('auto')
69
72
->cookieSamesite('lax')
73
+ ->storage_factory_id('session.storage.factory.native')
70
74
;
71
75
};
72
76
0 commit comments