开发者

invalidate a cookie on password change

开发者 https://www.devze.com 2023-01-06 03:06 出处:网络
I use cookies to manage user sessions in my Rails app. I recently found that when a user changes the password, the cookie does not 开发者_JAVA百科get invalidated as expected. As you realize, this coul

I use cookies to manage user sessions in my Rails app. I recently found that when a user changes the password, the cookie does not 开发者_JAVA百科get invalidated as expected. As you realize, this could be a great threat to security. How should I handle this problem? I want to expire or invalidate a cookie once the user changes the password. How do I do this in Rails. Thanks.


Destroy the session as you would on a logout; and ask the user to log back in.

http://api.rubyonrails.org/classes/ActionController/Base.html#M000474

0

精彩评论

暂无评论...
验证码 换一张
取 消