Wexus2 0.20
|
#include <SessionManager.h>
Classes | |
class | Data |
class | Locker |
Public Member Functions | |
SessionManager (int expiry_seconds=3600) | |
Locker | getData (const QUuid &id) |
Locker | getDataByCookie (Cookies &cookies) |
void | putData (const QUuid &id, std::shared_ptr< Data > &dat) |
Protected Member Functions | |
void | pruneExpiredSessions (const QDateTime &now) |
A map of UUIDs to sessions. rename this, perhaps?
wexus::SessionManager::SessionManager | ( | int | expiry_seconds = 3600 | ) |
Constructs a session manager with the expiry time length.
expiry_seconds | the expiry time, in seconds. Could be 0, for no expiry, but this is not recommended (could leak sessions, then) |
Locker wexus::SessionManager::getData | ( | const QUuid & | id | ) |
Gets a session based on the given id. If one doesn't exist, a new one will be created and returned.
Extra the session by the UUID stored in the session cookie, if any.
void wexus::SessionManager::putData | ( | const QUuid & | id, |
std::shared_ptr< Data > & | dat | ||
) |