Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0087f939
Commit
0087f939
authored
Jun 01, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update session cookie key name to be unique to instance in development
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/31644
parent
dd0f8b8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
changelogs/unreleased/31644-make-cookie-sessions-unique.yml
changelogs/unreleased/31644-make-cookie-sessions-unique.yml
+4
-0
config/initializers/session_store.rb
config/initializers/session_store.rb
+7
-1
No files found.
changelogs/unreleased/31644-make-cookie-sessions-unique.yml
0 → 100644
View file @
0087f939
---
title
:
Update session cookie key name to be unique to instance in development
merge_request
:
author
:
config/initializers/session_store.rb
View file @
0087f939
...
@@ -10,6 +10,12 @@ rescue
...
@@ -10,6 +10,12 @@ rescue
Settings
.
gitlab
[
'session_expire_delay'
]
||=
10080
Settings
.
gitlab
[
'session_expire_delay'
]
||=
10080
end
end
cookie_key
=
if
Rails
.
env
.
development?
"_gitlab_session_
#{
Digest
::
SHA256
.
hexdigest
(
Rails
.
root
.
to_s
)
}
"
else
"_gitlab_session"
end
if
Rails
.
env
.
test?
if
Rails
.
env
.
test?
Gitlab
::
Application
.
config
.
session_store
:cookie_store
,
key:
"_gitlab_session"
Gitlab
::
Application
.
config
.
session_store
:cookie_store
,
key:
"_gitlab_session"
else
else
...
@@ -19,7 +25,7 @@ else
...
@@ -19,7 +25,7 @@ else
Gitlab
::
Application
.
config
.
session_store
(
Gitlab
::
Application
.
config
.
session_store
(
:redis_store
,
# Using the cookie_store would enable session replay attacks.
:redis_store
,
# Using the cookie_store would enable session replay attacks.
servers:
redis_config
,
servers:
redis_config
,
key:
'_gitlab_session'
,
key:
cookie_key
,
secure:
Gitlab
.
config
.
gitlab
.
https
,
secure:
Gitlab
.
config
.
gitlab
.
https
,
httponly:
true
,
httponly:
true
,
expires_in:
Settings
.
gitlab
[
'session_expire_delay'
]
*
60
,
expires_in:
Settings
.
gitlab
[
'session_expire_delay'
]
*
60
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment