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
This commit is contained in:
Jean-Philippe Lang 2013-03-02 20:30:57 +00:00
parent 08ef201cec
commit a010372458
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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