Closed drefined closed 11 years ago
I don't have this issue (and anyway, it cannot be related to my fix for #409). Can you double-check your code? If you cannot find the issue, can you copy/paste a small-one-file-app that demonstrates the problem? Thanks.
It's just a simple app that does login and logout. For some reason, the logout does not do anything as I was still able to access admin after logout. Am I missing something? https://gist.github.com/3072797
your logout path needs to be in the scope of the firewall, otherwise the firewall cannot handle the logout.
@stof Could you please provide an example? TIA :)
/logout
does not match your pattern which is ^/admin/?
. you should use /admin/logout
@stof, sorry that still didn't work for me.
Neither works for me. $app['security.firewalls'] = array( 'admin' => array( 'pattern' => '^/admin/', 'form' => array('login_path' => '/login', 'check_path' => '/admin/login_check'), 'logout' => array('logout_path' => '/logout'), 'users' => array( // raw password is foo 'admin' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='), ), ), );
Logout produces white screen, and no logout, i can still reach admin section after logout.
Well, you config still uses /logout
as logout path, which does not match the ^/admin/
regex.
But does this means i have to have two firewall rules ? Or must we define two routes ?
Never mind, i have looked at how fos userbundle was doing it in symfony and copied that, works as a charm.
In early faced with the same problem of a white screen, when did everything in the documentation. But adjusting to the way he went into the path of a protected area - it worked! So? solution is: https://github.com/fabpot/Silex/issues/423#issuecomment-6835122
I too was tripped up by this; hopefully a little clarification in the docs will help.
The fix to issue #409 works perfectly, but now when I try to log out, nothing happens. It seems the session is still there.
Regards, David