Skip to content
Snippets Groups Projects
Commit 177b788c authored by Eric Eastwood's avatar Eric Eastwood
Browse files

Update session cookie key name to be unique to instance in development

parent dd0f8b8c
No related branches found
No related tags found
No related merge requests found
Pipeline #
---
title: Update session cookie key name to be unique to instance in development
merge_request:
author:
Loading
Loading
@@ -10,8 +10,14 @@ rescue
Settings.gitlab['session_expire_delay'] ||= 10080
end
 
cookie_key = if Rails.env.development?
"_gitlab_session_#{Digest::SHA256.hexdigest(Rails.root.to_s)}"
else
"_gitlab_session"
end
if Rails.env.test?
Gitlab::Application.config.session_store :cookie_store, key: "_gitlab_session"
Gitlab::Application.config.session_store :cookie_store, key: cookie_key
else
redis_config = Gitlab::Redis.params
redis_config[:namespace] = Gitlab::Redis::SESSION_NAMESPACE
Loading
Loading
@@ -19,7 +25,7 @@ else
Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks.
servers: redis_config,
key: '_gitlab_session',
key: cookie_key,
secure: Gitlab.config.gitlab.https,
httponly: true,
expires_in: Settings.gitlab['session_expire_delay'] * 60,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment