Allow parameter use_cookies in session configuration.
This commit is contained in:
parent
93e69e4735
commit
08bf50ab70
@ -341,6 +341,7 @@ class Configuration implements ConfigurationInterface
|
||||
->scalarNode('cookie_domain')->end()
|
||||
->booleanNode('cookie_secure')->end()
|
||||
->booleanNode('cookie_httponly')->end()
|
||||
->booleanNode('use_cookies')->end()
|
||||
->scalarNode('gc_divisor')->end()
|
||||
->scalarNode('gc_probability')->defaultValue(1)->end()
|
||||
->scalarNode('gc_maxlifetime')->end()
|
||||
|
@ -396,7 +396,7 @@ class FrameworkExtension extends Extension
|
||||
// session storage
|
||||
$container->setAlias('session.storage', $config['storage_id']);
|
||||
$options = array();
|
||||
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
|
||||
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
|
||||
if (isset($config[$key])) {
|
||||
$options[$key] = $config[$key];
|
||||
}
|
||||
|
@ -107,6 +107,7 @@
|
||||
<xsd:attribute name="cookie-domain" type="xsd:string" />
|
||||
<xsd:attribute name="cookie-secure" type="xsd:boolean" />
|
||||
<xsd:attribute name="cookie-httponly" type="xsd:boolean" />
|
||||
<xsd:attribute name="use-cookies" type="xsd:boolean" />
|
||||
<xsd:attribute name="cache-limiter" type="xsd:string" />
|
||||
<xsd:attribute name="gc-maxlifetime" type="xsd:string" />
|
||||
<xsd:attribute name="gc-divisor" type="xsd:string" />
|
||||
|
@ -33,6 +33,7 @@ $container->loadFromExtension('framework', array(
|
||||
'cookie_domain' => 'example.com',
|
||||
'cookie_secure' => true,
|
||||
'cookie_httponly' => true,
|
||||
'use_cookies' => true,
|
||||
'gc_maxlifetime' => 90000,
|
||||
'gc_divisor' => 108,
|
||||
'gc_probability' => 1,
|
||||
|
@ -14,7 +14,7 @@
|
||||
<framework:esi enabled="true" />
|
||||
<framework:profiler only-exceptions="true" enabled="false" />
|
||||
<framework:router resource="%kernel.root_dir%/config/routing.xml" type="xml" />
|
||||
<framework:session gc-maxlifetime="90000" gc-probability="1" gc-divisor="108" storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="true" save-path="/path/to/sessions" />
|
||||
<framework:session gc-maxlifetime="90000" gc-probability="1" gc-divisor="108" storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="true" use-cookies="true" save-path="/path/to/sessions" />
|
||||
<framework:request>
|
||||
<framework:format name="csv">
|
||||
<framework:mime-type>text/csv</framework:mime-type>
|
||||
|
@ -25,6 +25,7 @@ framework:
|
||||
cookie_domain: example.com
|
||||
cookie_secure: true
|
||||
cookie_httponly: true
|
||||
use_cookies: true
|
||||
gc_probability: 1
|
||||
gc_divisor: 108
|
||||
gc_maxlifetime: 90000
|
||||
|
@ -150,6 +150,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertEquals('example.com', $options['cookie_domain']);
|
||||
$this->assertTrue($options['cookie_secure']);
|
||||
$this->assertTrue($options['cookie_httponly']);
|
||||
$this->assertTrue($options['use_cookies']);
|
||||
$this->assertEquals(108, $options['gc_divisor']);
|
||||
$this->assertEquals(1, $options['gc_probability']);
|
||||
$this->assertEquals(90000, $options['gc_maxlifetime']);
|
||||
|
Reference in New Issue
Block a user