cookies 删除也需要domain
This commit is contained in:
parent
1919292c58
commit
47e3e93a2f
|
@ -336,7 +336,7 @@ class AccountController < ApplicationController
|
|||
:expires => 1.month.from_now,
|
||||
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
|
||||
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
|
||||
:domain => '.trustie.net',
|
||||
:domain => Redmine::Configuration['cookie_domain'],
|
||||
:httponly => true
|
||||
}
|
||||
cookies[autologin_cookie_name] = cookie_options
|
||||
|
|
|
@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base
|
|||
# Logs out current user
|
||||
def logout_user
|
||||
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'])
|
||||
self.logged_user = nil
|
||||
end
|
||||
|
|
|
@ -90,6 +90,7 @@ default:
|
|||
user_name: "huang.jingquan@163.com"
|
||||
password: 'xinhu1ji2qu366'
|
||||
|
||||
cookie_domain: ".trustie.net"
|
||||
# Absolute path to the directory where attachments are stored.
|
||||
# The default is the 'files' directory in your Redmine instance.
|
||||
# Your Redmine instance needs to have write permission on this
|
||||
|
|
Loading…
Reference in New Issue