mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-07 18:17:38 +02:00
Optimized panel login
This commit is contained in:
@@ -275,6 +275,7 @@ class MemcachedSessionInterface(SessionInterface):
|
||||
httponly = self.get_cookie_httponly(app)
|
||||
secure = self.get_cookie_secure(app)
|
||||
expires = self.get_expiration_time(app, session)
|
||||
samesite = self.get_cookie_samesite(app)
|
||||
if not PY2:
|
||||
val = self.serializer.dumps(dict(session), 0)
|
||||
else:
|
||||
@@ -285,9 +286,18 @@ class MemcachedSessionInterface(SessionInterface):
|
||||
session_id = self._get_signer(app).sign(want_bytes(session.sid))
|
||||
else:
|
||||
session_id = session.sid
|
||||
response.set_cookie(app.session_cookie_name, session_id,
|
||||
from BTPanel import request,g
|
||||
if 'auth_error' in g: return
|
||||
if request.path == '/': return
|
||||
if response.status_code not in [200,302]: return
|
||||
if not request.cookies.get(app.session_cookie_name):
|
||||
if request.full_path.find('/login?tmp_token=') == 0:
|
||||
samesite = 'None'
|
||||
secure = True
|
||||
response.set_cookie(app.session_cookie_name, session_id,
|
||||
expires=expires, httponly=httponly,
|
||||
domain=domain, path=path, secure=secure)
|
||||
domain=domain, path=path, secure=secure,samesite=samesite)
|
||||
|
||||
|
||||
|
||||
class FileSystemSessionInterface(SessionInterface):
|
||||
|
||||
Reference in New Issue
Block a user