Well, I have this security.yml
# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:
encoders:
BackendBundle\Entity\.....:
algorithm: bcrypt
cost: 4
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-
loaded
providers:
our_db_provider:
entity:
class: BackendBundle:......
property: email
# in_memory:
# memory: ~
firewalls:
# disables authentication for assets and the profiler, adapt it
according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
# activate different ways to authenticate
form_login:
login_path: /login
check_path: /login_check
username_parameter: _email
logout:
path: /logout
target: /
#https://symfony.com/doc/current/security.html#a-configuring- how-your-users-will-authenticate
#http_basic: ~
# https://symfony.com/doc/current/security/form_login_setup.html
#form_login: ~
access_control:
- { path: ^/back, roles: ROLE_ADMIN }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_USER, ROLE_ALLOWED_TO_SWITCH]
and this route:
backoffice_list_paginas:
path: /back/listPagina
defaults: { _controller: BackendBundle:Paginas:list }
When you call that route, everything you do afterwards (calls to other routes) such as this one:
backoffice_list_modificable:
path: /back/listModif/{idPagina}
defaults: { _controller: BackendBundle:Modificables:listModif }
called like this:
<a href="{{ path('backoffice_list_modificable',{'idPagina' : pag.getId() })}}" title="Editar"><i class="pe-7s-scissors"></i></a>
produces a logout with the loss of the user session, appearing the user to null, and then a call to the login function, which produces a redirection to the home without even passing through the controller's function Modifiable: listModif
Any idea why this is happening to me? Thank you very much