销毁rails 3中的所有会话

时间:2012-02-15 10:39:11

标签: ruby ruby-on-rails-3 ruby-on-rails-3.2

只是想知道有没有办法从服务器端销毁rails应用程序的所有会话。目前我们有一个自动重定向,如果有人登录。我想为那些登录的用户停止。我正在考虑重置安全令牌(在application_controller中)然后部署。但是我从文档中看到它引发了一个例外。在Rails 3.2.0中是否有清洁工可以做到这一点?

由于

1 个答案:

答案 0 :(得分:1)

我将在config/initializers/secret_token.rb

中更改会话令牌
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
MyAPP::Application.config.secret_token = 'ABC123'