Browse Source

Better session logic.

pull/273/head
Armin Ronacher 14 years ago
parent
commit
585bf02ee0
  1. 13
      flask/sessions.py

13
flask/sessions.py

@ -169,9 +169,10 @@ class SecureCookieSessionInterface(SessionInterface):
def save_session(self, app, session, response): def save_session(self, app, session, response):
expires = self.get_expiration_time(app, session) expires = self.get_expiration_time(app, session)
domain = self.get_cookie_domain(app) domain = self.get_cookie_domain(app)
if session.modified and not session: if not session:
response.delete_cookie(app.session_cookie_name, if session.modified:
domain=domain) response.delete_cookie(app.session_cookie_name,
else: domain=domain)
session.save_cookie(response, app.session_cookie_name, return
expires=expires, httponly=True, domain=domain) session.save_cookie(response, app.session_cookie_name,
expires=expires, httponly=True, domain=domain)

Loading…
Cancel
Save