Utils Sessions
inyoka.utils.sessions
Session related utility functions.
- copyright:
2007-2024 by the Inyoka Team, see AUTHORS for more details.
- license:
BSD, see LICENSE for more details.
- class inyoka.utils.sessions.SurgeProtectionMixin
Mixin for forms to override the clean() method to perform an additional surge protection. Give this method a higher MRO than the form baseclass!
- clean()
- get_surge_protection_identifier()
- surge_protection_identifier = None
- surge_protection_message = 'You cannot send data that fast in a row. Please wait a bit until you submit the form again.'
- surge_protection_timeout = 15
- inyoka.utils.sessions.get_sessions(order_by='-last_change')
Get a simple list of active sessions for the portal index.
- inyoka.utils.sessions.get_user_record(values=None)
Get a tuple for the user record in the format
(number, timestamp)
where number is an integer with the number of online users and timestamp a datetime object.
- inyoka.utils.sessions.is_permanent(request)
Check if the session is permanent.
- inyoka.utils.sessions.make_permanent(request)
Make this session a permanent one.
- inyoka.utils.sessions.set_session_info(request)
Set the session info.