Skip to content

Commit

Permalink
Set path attribute in session cookie when relative url is set (#5651)
Browse files Browse the repository at this point in the history
* Set path attribute in session cookie when relative url is set

* Update session_store.rb

---------

Co-authored-by: Ahmad Farhat <ahmad.farhat@blindsidenetworks.com>
  • Loading branch information
wolbernd and farhatahmad authored Jan 8, 2024
1 parent 3302345 commit a9a8181
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# frozen_string_literal: true

if ENV['LOADBALANCER_ENDPOINT'].present?
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session', domain: ENV.fetch('SESSION_DOMAIN_NAME', nil)
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session', domain: ENV.fetch('SESSION_DOMAIN_NAME', nil),
path: ENV.fetch('RELATIVE_URL_ROOT', '/')
else
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session'
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session', path: ENV.fetch('RELATIVE_URL_ROOT', '/')
end

0 comments on commit a9a8181

Please sign in to comment.