-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remember me cookie cannot be set from the Action Controller #3137
Comments
Can you explain more? I don't get it. |
Closing this as it is unclear and no feedback has been provided. |
I guess what he wants is to set a remember me cookie programmatically from any action. I agree this would be useful for some use cases. Right now figuring out how to do this is quite non trivial since it is done automagically deep into Security-land. If you don't mind I reopen. |
This would be very useful for me: I'm using MultiPass library and I'm authenticating users with Fb/Google/twitter/... and I want to persist the login, but I cant do that inside the controller. $rememberMeService = new TokenBasedRememberMeServices(
array($userRepo),
$secretkey, $firewallname, array(
'path' => '/',
'name' => 'REMEMBERME',
'domain' => null,
'secure' => false,
'httponly' => true,
'lifetime' => 2592000, // 30 days
'always_remember_me' => true,
'remember_me_parameter' => '_remember_me')
); |
I've looked into this and it is possible to set a the cookie from a controller action, but it requires quite some work. You need to:
Finally, if your rememberme services are not configured to always set the remember me cookie, you need to "fake" the All of this is a tricky, but I personally don't see a straightforward way to make this process a lot easier without refactoring quite a bit (for example, the rememberme services being dependent on a firewall name). @albyrock87 For your usecase I think you should consider to implement your authentication scheme as an authentication provider. Right now I guess you're doing everything in a controller? |
@asm89 Yes, I'm using a controller, but you're right, I should consider to implement an authentication provider :) |
@albyrock87 Not sure what you're authenticating against, but I'd like to shamelessly plug HWIOAuthBundle which supports facebook/google/twitter etc. ;) |
@asm89 Thank you very, very much! I searched for something like that in packagist.org, but I didn't found HWIOAuthBundle weeks ago! That's awesome! |
Here is the logic written by @schmittjoh to fix this in FOSUserBundle a few days ago: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Security/LoginManager.php |
Was the |
also related to #6904 |
i just hit this wall, any update? |
I think this issue can be closed because there is no activity for 1 year and all the pull requests have been closed |
This is common pattern when user clicks confirmation token.
I'm unable to set remember me in clean way.
The text was updated successfully, but these errors were encountered: