Middlewares Session

inyoka.middlewares.session

A custom version of the session middleware that allows to set the session time (permanent, non permanent) on a session basis. So users can decide to have a permanent session on login.

Uses client side storage.

copyright:
  1. 2007-2024 by the Inyoka Team, see AUTHORS for more details.

license:

BSD, see LICENSE for more details.

class inyoka.middlewares.session.SessionMiddleware(get_response)

Session middleware that allows you to turn individual browser-length sessions into persistent sessions and vice versa.

This middleware can be used to implement the common “Remember Me” feature that allows individual users to decide when their session data is discarded. If a user ticks the “Remember Me” check-box on your login form create a persistent session, if they don’t then create a browser-length session.

process_request(request)
process_response(request, response)

If request.session was modified, or if the configuration is to save the session every time, save the changes and set a session cookie or delete the session cookie if the session has been emptied.