Use config.relative_url_root as the default path for session and autologin cookies (#21169).

Patch by Daniel Ritz.

git-svn-id: http://svn.redmine.org/redmine/trunk@14876 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-11-14 10:04:08 +00:00
parent 1a860d5320
commit 703d8a4782
2 changed files with 4 additions and 2 deletions

View File

@@ -272,7 +272,7 @@ class AccountController < ApplicationController
cookie_options = {
:value => token.value,
:expires => 1.year.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:path => (Redmine::Configuration['autologin_cookie_path'] || RedmineApp::Application.config.relative_url_root || '/'),
:secure => secure,
:httponly => true
}

View File

@@ -72,7 +72,9 @@ module RedmineApp
# can change it (environments/ENV.rb would take precedence over it)
config.log_level = Rails.env.production? ? :info : :debug
config.session_store :cookie_store, :key => '_redmine_session'
config.session_store :cookie_store,
:key => '_redmine_session',
:path => config.relative_url_root || '/'
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))