8000 bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode"… · symfony/symfony@ac9a527 · GitHub
[go: up one dir, main page]

Skip to content

Commit ac9a527

Browse files
committed
bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT It is currently not possible to configure the `use_strict_mode` option for `NativeSessionStorage` in a proper manner. The reason of this PR: #22352 (comment) It could be considered a new feature, but I wish it wouldn't, as I don't want to do any ugly hacking to get it working. What else could be done? * implement more options from `NativeSessionStorage` in the config? * get rid of duplication somehow (maybe a static method in `NativeSessionStorage` that would return the option list and could be used in `FrameworkExtension`?) * update `FrameworkExtensionTest`? * update `ConfigurationTest`? * update [the docs](https://symfony.com/doc/current/reference/configuration/framework.html#session)? I'm willing to do those if decided. Commits ------- 90e192e Sessions: configurable "use_strict_mode" option for NativeSessionStorage
2 parents 436d5e4 + 90e192e commit ac9a527

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
348348
->scalarNode('gc_divisor')->end()
349349
->scalarNode('gc_probability')->defaultValue(1)->end()
350350
->scalarNode('gc_maxlifetime')->end()
351+
->booleanNode('use_strict_mode')->end()
351352
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
352353
->integerNode('metadata_update_threshold')
353354
->defaultValue('0')

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
402402
// session storage
403403
$container->setAlias('session.storage', $config['storage_id']);
404404
$options = array();
405-
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
405+
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor', 'use_strict_mode') as $key) {
406406
if (isset($config[$key])) {
407407
$options[$key] = $config[$key];
408408
}

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<xsd:attribute name="gc-maxlifetime" type="xsd:string" />
112112
<xsd:attribute name="gc-divisor" type="xsd:string" />
113113
<xsd:attribute name="gc-probability" type="xsd:string" />
114+
<xsd:attribute name="use-strict-mode" type="xsd:boolean" />
114115
<xsd:attribute name="save-path" type="xsd:string" />
115116
</xsd:complexType>
116117

0 commit comments

Comments
 (0)
0