可以为所有用户重置会话吗? [英] Possible to reset sessions for all users?

查看:43
本文介绍了可以为所有用户重置会话吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于身份验证程序的更改,我需要为所有用户重置所有会话,我该如何在 Rails 4 中执行此操作?

Due to change in authentication procedure I need to reset all sessions for all users, how do I do this in Rails 4?

推荐答案

您可以在 config/initializers/secret_token.rb 中更改您的应用用于加密 cookie 的 secret_key 或者您可以在 config/initializers 中更改 cookie 密钥的名称/session_store.rb 这些更改中的任何一个都会使所有会话无效并要求重新创建它们(再次登录)

You can change the secret_key your app uses to encrypt cookies in config/initializers/secret_token.rb or you can change the name of the cookie key in config/initializers/session_store.rb either of these changes will invalidate all sessions and require them to be recreated (login again)

这篇关于可以为所有用户重置会话吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆