2012-02-15 125 views
1

只想知道是否有辦法從服務器端銷燬所有rails應用程序的會話。目前我們有一個自動重定向,如果有人登錄。我想停止登錄的用戶。我想重置安全令牌(在application_controller中),然後部署。但是我從文檔中看到它引發了一個例外。有沒有更清潔的人在Rails 3.2.0中做到這一點?銷燬rails中的所有會話3

感謝

+0

這是否幫助解決這個問題:http://stackoverflow.com/questions/6837620/in-rails-how當你瀏覽器關閉時,你會銷燬一個會話 – ScottJShea 2012-02-15 11:07:08

回答

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' 
+0

只是現在試過了,儘管我讀了什麼,也不會引發錯誤.. thx! – charleetm 2012-02-15 13:42:13