2012-02-15 7 views
1

서버 측에서 레일스 애플리케이션의 모든 세션을 삭제하는 방법이 있는지 알고 싶습니다. 현재 누군가가 로그인 한 경우 자동 리디렉션이 있습니다. 로그인 한 사용자의 경우이를 중지하고 싶습니다. 보안 토큰을 재설정 (application_controller에서) 한 다음 배포 할 생각이었습니다. 그러나 문서에서 예외가 발생합니다. Rails 3.2.0에서 이것을 수행하는 클리너가 있습니까?레일에있는 모든 세션 삭제 3

감사

+0

이 도움이 주소에게 문제를합니까 : http://stackoverflow.com/questions/6837620/in-rails-how -do-you-destroy-a-session-when-a-browser-is-closed – ScottJShea

답변

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

지금 막 시도해 보았고 내가 읽은 책에도 불구하고 오류를 발생시키지 않았습니다. – charleetm

관련 문제