Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
3b67bd3b
Commit
3b67bd3b
authored
Jul 30, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修复浏览器关闭后session不失效的问题
parent
bb235f3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
middleware.py
apps/jumpserver/middleware.py
+4
-2
No files found.
apps/jumpserver/middleware.py
View file @
3b67bd3b
...
...
@@ -5,6 +5,7 @@ import re
import
pytz
from
django.utils
import
timezone
from
django.shortcuts
import
HttpResponse
from
django.conf
import
settings
from
.utils
import
set_current_request
...
...
@@ -56,6 +57,7 @@ class RequestMiddleware:
def
__call__
(
self
,
request
):
set_current_request
(
request
)
response
=
self
.
get_response
(
request
)
age
=
request
.
session
.
get_expiry_age
()
request
.
session
.
set_expiry
(
age
)
if
not
settings
.
SESSION_EXPIRE_AT_BROWSER_CLOSE
:
age
=
request
.
session
.
get_expiry_age
()
request
.
session
.
set_expiry
(
age
)
return
response
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