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.

17 lines
561 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. # pylint: disable=useless-return
  10. def save_session(self, app: Any, session: Any, response: Any) -> Any:
  11. """Prevent creating session from requests."""
  12. return None