An ebook/comic library service and web client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
524 B

  1. """Session specific utilities."""
  2. from typing import Any
  3. from flask.sessions import SecureCookieSessionInterface
  4. class DisableSessionInterface(SecureCookieSessionInterface):
  5. """Make sure no session data is transmitted or stored."""
  6. def should_set_cookie(self, app: Any, session: Any) -> bool:
  7. """Disable default cookie generation."""
  8. return False
  9. def save_session(self, app: Any, session: Any, response: Any) -> Any:
  10. """Prevent creating session from requests."""
  11. return None