session-path-when-using-RAILS_RELATIVE_URL_ROOT_v2.patch

session cookie and autologin cookie path - Daniel Ritz, 2015-11-07 15:40

Download (1.3 KB)

View differences:

app/controllers/account_controller.rb
272 272
    cookie_options = {
273 273
      :value => token.value,
274 274
      :expires => 1.year.from_now,
275
      :path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
275
      :path => (Redmine::Configuration['autologin_cookie_path'] || RedmineApp::Application.config.relative_url_root || '/'),
276 276
      :secure => secure,
277 277
      :httponly => true
278 278
    }
config/application.rb
72 72
    # can change it (environments/ENV.rb would take precedence over it)
73 73
    config.log_level = Rails.env.production? ? :info : :debug
74 74

  
75
    config.session_store :cookie_store, :key => '_redmine_session'
75
    config.session_store :cookie_store,
76
      :key => '_redmine_session',
77
      :path => config.relative_url_root || '/'
76 78

  
77 79
    if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
78 80
      instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
79
-