By default, _redmine_session cookie path is / This patch sets the path to ENV['RAILS_RELATIVE_URL_ROOT'], so that multiple instances of redmine have distinct session cookies in any case. diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake index ce87475..80c0268 100644 --- a/lib/tasks/initializers.rake +++ b/lib/tasks/initializers.rake @@ -15,8 +15,10 @@ file 'config/initializers/session_store.rb' do # change this key, all old sessions will become invalid! Make sure the # secret is at least 30 characters and all random, no regular words or # you'll be exposed to dictionary attacks. +relativeUrlRoot = ENV['RAILS_RELATIVE_URL_ROOT'] ActionController::Base.session = { :session_key => '_redmine_session', + :session_path => (relativeUrlRoot.nil? or relativeUrlRoot.empty?) ? '/' : relativeUrlRoot, :secret => '#{secret}' } EOF