Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca (strifel)
uffd
Commits
77d2c30c
Commit
77d2c30c
authored
2 years ago
by
Russ Garrett
Committed by
Julian
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use permanent rather than session cookies
parent
2b5ab52b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
uffd/default_config.cfg
+5
-0
5 additions, 0 deletions
uffd/default_config.cfg
uffd/session/views.py
+1
-0
1 addition, 0 deletions
uffd/session/views.py
with
6 additions
and
0 deletions
uffd/default_config.cfg
+
5
−
0
View file @
77d2c30c
...
...
@@ -9,7 +9,12 @@ USER_SERVICE_MAX_UID=19999
GROUP_MIN_GID
=
20000
GROUP_MAX_GID
=
49999
# The period of time that a login lasts for.
SESSION_LIFETIME_SECONDS
=
3600
# The period of time that the session cookie lasts for. This is refreshed on each page load.
PERMANENT_SESSION_LIFETIME
=
2678400
# CSRF protection
SESSION_COOKIE_SECURE
=
True
SESSION_COOKIE_HTTPONLY
=
True
...
...
This diff is collapsed.
Click to expand it.
uffd/session/views.py
+
1
−
0
View file @
77d2c30c
...
...
@@ -49,6 +49,7 @@ def logout():
def
set_session
(
user
,
skip_mfa
=
False
):
session
.
clear
()
session
.
permanent
=
True
session
[
'
user_id
'
]
=
user
.
id
session
[
'
logintime
'
]
=
datetime
.
datetime
.
now
().
timestamp
()
session
[
'
_csrf_token
'
]
=
secrets
.
token_hex
(
128
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment