Symfony - Error LogicException CSRF protection needs sessions to be enabled.

 
Vista:
sin imagen de perfil

Error LogicException CSRF protection needs sessions to be enabled.

Publicado por Fernando (16 intervenciones) el 07/07/2017 09:50:19
Hola,

He instalado realizado los siguientes cambios en mi symfony:
Lo he actualizado de la versión 3.2 a 3.3 sin problemas.

He añadido la libreria asset añadiendo la siguientes lineas a mi archivo config.yml:

1
2
3
4
5
assetic:
    debug:          '%kernel.debug%'
    use_controller: '%kernel.debug%'
    filters:
    cssrewrite: ~

Pero al intentar instalar la libreria scss siguiendo los siguientes pasos en este link:

https://symfony.com/doc/current/assetic/php.html#combining-and-minimizing-css-files-and-compiling-scss-files

Me da este error:


Error LogicException CSRF protection needs sessions to be enabled.

Esto es lo que hay en mi archivo config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: "@BlogBundle/Resources/config/services.yml" }
 
# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: en

framework:
    #esi: ~
    translator: { fallbacks: ['%locale%'] }
    secret: '%secret%'
    router:
        resource: '%kernel.root_dir%/config/routing.yml'
        strict_requirements: ~
    form: ~
    csrf_protection: ~
    validation: { enabled: true, enable_annotations: true }
    #serializer: { enable_annotations: true }
 
assetic:
    debug:          '%kernel.debug%'
    use_controller: '%kernel.debug%'
    filters:
    cssrewrite: ~

assetic:
    filters:
        scssphp:
            formatter: 'Leafo\ScssPhp\Formatter\Compressed'
# Twig Configuration
twig:
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Error LogicException CSRF protection needs sessions to be enabled.

Publicado por Fernando (16 intervenciones) el 07/07/2017 10:34:12
Lo he solucionado por una parte, he hecho estos cambios en assetic en el archivo config.yml

1
2
3
4
5
6
assetic:
    debug:          '%kernel.debug%'
    use_controller: '%kernel.debug%'
    filters:
        scssphp:
            formatter: 'Leafo\ScssPhp\Formatter\Compressed'

Pero ahora me da el siguiente error:

you have requested a non-existent parameter templating.engines
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar