1
votes

I'm trying to implement remember_me in login, but I Have some trouble

My user is authenticated, but when i try to logout, the user still authenticated ( I can see in debug toolbar)

This is security.yml

 remember_me:
      key:      "%secret%"
      lifetime: 31536000 
      path:     /
      domain:   ~ # Defaults to the current domain from $_SERVER

I try even invalidate_session: true but I have the same problem.

My Route

login_check:
    path: /login_check

logout:
    path:   /logout

like documentation. I didn't create controller about logout.

My questions are:

  1. How can I implement logout (if I don't add remember_me option, all works)
  2. How Symfony know where redirect for my action Logout? I saw that use this Handler

    Symfony/Component/Security/Http/Logout/LogoutSuccessHandlerInterface.php

Update

If Implement <a href="{{ url('logout') }}">Logout</a> in my twig, it works. I write logout in my browser, dosen't work... it's so strange

1

1 Answers

0
votes

Your firewall configuration should look like this:

# app/config/security.yml
security:
    firewalls:
        secured_area:
            logout: ~