InvalidConfigurationException:子节点" key"在路径" security.firewalls.main.remember_me"必须配置

时间:2014-06-03 16:22:23

标签: symfony

我尝试使用php composer.phar update在symfony2中更新我的供应商包,但是当我这样做时,我在这行后收到错误:

更新“app / config / parameters.yml”文件

我得到的错误是:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]           
The child node "key" at path "security.firewalls.main.remember_me" must be configured. 

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

[RuntimeException]                                                         
An error occurred when executing the "'cache:clear --no-warmup'" command. 

我的security.yml文件在其防火墙部分中包含以下内容:

firewalls:
    main:
        pattern: ^/
        provider: fos_userbundle
        form_login:
            csrf_provider: form.csrf_provider
            always_use_default_target_path: false
            default_target_path: webplio_site_dashboard_index
            #success_handler: webplio_site.login_success_handler
            check_path: /login_check
            login_path: /login
        logout: true
        remember_me: true
        anonymous: true
        remember_me:
            key: "%secret%"
            lifetime: 31536000 # 365 days in seconds
            path: /
            domain: ~ # Defaults to the current domain from $_SERVER

其中secret在我的parameters.yml文件中定义

我的问题是,为了在路径“security.firewalls.main.remember_me”配置子节点“key”,我还需要做些什么呢?

3 个答案:

答案 0 :(得分:3)

您需要从

更改
remember_me:
    key: "%secret%"

remember_me:
    secret: "%secret%"

答案 1 :(得分:1)

remember_me: true移至

form_login:
    ...
    remember_me: true

检查security-reference以了解原因。

答案 2 :(得分:0)

将密钥更改为机密