diff --git a/inginious/frontend/flask/mongo_sessions.py b/inginious/frontend/flask/mongo_sessions.py index 331eb0f2d2..fbe9fa56d3 100644 --- a/inginious/frontend/flask/mongo_sessions.py +++ b/inginious/frontend/flask/mongo_sessions.py @@ -86,7 +86,7 @@ def open_session(self, app, request): sid = None else: cookieless = False - sid = request.cookies.get(app.session_cookie_name) + sid = request.cookies.get(self.get_cookie_name(app)) if not sid: sid = self._generate_sid() @@ -124,8 +124,7 @@ def save_session(self, app, session, response): if not session: if session.modified: self.store.delete_one({'_id': store_id}) - response.delete_cookie(app.session_cookie_name, - domain=domain, path=path) + response.delete_cookie(self.get_cookie_name(app), domain=domain, path=path) return httponly = self.get_cookie_httponly(app) @@ -141,6 +140,6 @@ def save_session(self, app, session, response): else: session_id = session.sid if not cookieless: - response.set_cookie(app.session_cookie_name, session_id, + response.set_cookie(self.get_cookie_name(app), session_id, expires=expires, httponly=httponly, domain=domain, path=path, secure=secure) diff --git a/setup.py b/setup.py index a226920a4d..69484b4d2b 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ "WsgiDAV >= 3.0.0", "Werkzeug >= 1.0.0", "itsdangerous >= 1.1.0", - "Flask >= 1.1.0", + "Flask >= 2.0.0", "Flask-Mail >= 0.9.1", "importlib_metadata >= 3.7.0", 'dataclasses >= 0.8; python_version < "3.7.0"',