Browse Source

Change

pull/278/head
sylor_huang@126.com 5 years ago
parent
commit
d4d412ab40
2 changed files with 10 additions and 8 deletions
  1. +5
    -4
      app/controllers/accounts_controller.rb
  2. +5
    -4
      app/controllers/concerns/login_helper.rb

+ 5
- 4
app/controllers/accounts_controller.rb View File

@@ -263,11 +263,12 @@ class AccountsController < ApplicationController
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => true
:httponly => true,
:domain => "/"
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
# if edu_setting('cookie_domain').present?
# cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
# end
cookies[autologin_cookie_name] = cookie_options
cookies.signed[:user_id] ||= user.id


+ 5
- 4
app/controllers/concerns/login_helper.rb View File

@@ -17,11 +17,12 @@ module LoginHelper
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => false
:httponly => false,
:domain => "/"
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
# if edu_setting('cookie_domain').present?
# cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
# end
unless cookies[autologin_cookie_name].present?
cookies[autologin_cookie_name] = cookie_options
end


Loading…
Cancel
Save