cookies 删除也需要domain

dev_repository_hjq
guange 10 years ago
parent 1919292c58
commit 47e3e93a2f

@ -336,7 +336,7 @@ class AccountController < ApplicationController
:expires => 1.month.from_now, :expires => 1.month.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'), :path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:domain => '.trustie.net', :domain => Redmine::Configuration['cookie_domain'],
:httponly => true :httponly => true
} }
cookies[autologin_cookie_name] = cookie_options cookies[autologin_cookie_name] = cookie_options

@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base
# Logs out current user # Logs out current user
def logout_user def logout_user
if User.current.logged? if User.current.logged?
cookies.delete(autologin_cookie_name) cookies.delete(autologin_cookie_name, domain: Redmine::Configuration['cookie_domain'])
# Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
self.logged_user = nil self.logged_user = nil
end end

@ -90,6 +90,7 @@ default:
user_name: "huang.jingquan@163.com" user_name: "huang.jingquan@163.com"
password: 'xinhu1ji2qu366' password: 'xinhu1ji2qu366'
cookie_domain: ".trustie.net"
# Absolute path to the directory where attachments are stored. # Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your Redmine instance. # The default is the 'files' directory in your Redmine instance.
# Your Redmine instance needs to have write permission on this # Your Redmine instance needs to have write permission on this

Loading…
Cancel
Save