diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-02 20:30:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-02 20:30:57 +0000 |
commit | a010372458bc529075c9b4d6c89d2863be0503c3 (patch) | |
tree | ab776c35607affe94186c4878704f55928c2e78e | |
parent | 08ef201cec0c1524ba74f31cf26a516980123974 (diff) | |
download | redmine-a010372458bc529075c9b4d6c89d2863be0503c3.tar.gz redmine-a010372458bc529075c9b4d6c89d2863be0503c3.zip |
Fixed that autologin cookie is not deleted when using custom cookie name (#13335).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11520 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | test/integration/account_test.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9948e717e..6bbc4d1fc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -157,7 +157,7 @@ class ApplicationController < ActionController::Base # Logs out current user def logout_user if User.current.logged? - cookies.delete :autologin + cookies.delete(autologin_cookie_name) Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) self.logged_user = nil end diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index bdd9cb5d3..de78ba7d3 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -87,6 +87,11 @@ class AccountTest < ActionController::IntegrationTest cookies['custom_autologin'] = token get '/my/page' assert_response :success + + assert_difference 'Token.count', -1 do + post '/logout' + end + assert cookies['custom_autologin'].blank? end end |