tufao
1.3.0
An asynchronous web framework for C++ built on top of Qt
|
SimpleSessionStore implements a simple storage mechanism to SessionStore. More...
Public Member Functions | |
SimpleSessionStore (const SessionSettings &settings=defaultSettings(), QObject *parent=0) | |
Constructs a new SimpleSessionStore object. More... | |
~SimpleSessionStore () | |
Destructs a SimpleSessionStore object. | |
int | refreshInterval () const |
The refresh interval used to look for (and delete) expired cookies. More... | |
void | setRefreshInterval (int msecs) |
Sets the refresh interval used to look for (and delete) expired cookies. | |
bool | hasSession (const HttpServerRequest &request) const override |
Implements SessionStore::hasSession. | |
void | removeSession (const HttpServerRequest &request, HttpServerResponse &response) override |
Implements SessionStore::removeSession. | |
QList< QByteArray > | properties (const HttpServerRequest &request, const HttpServerResponse &response) const override |
Implements SessionStore::properties. | |
bool | hasProperty (const HttpServerRequest &request, const HttpServerResponse &response, const QByteArray &key) const override |
Implements SessionStore::hasProperty. | |
QVariant | property (const HttpServerRequest &request, HttpServerResponse &response, const QByteArray &key) const override |
Implements SessionStore::property. | |
void | setProperty (const HttpServerRequest &request, HttpServerResponse &response, const QByteArray &key, const QVariant &value) override |
Implements SessionStore::setProperty. | |
void | removeProperty (const HttpServerRequest &request, HttpServerResponse &response, const QByteArray &key) override |
Implements SessionStore::removeProperty. | |
Public Member Functions inherited from Tufao::SessionStore | |
SessionStore (const SessionSettings &settings=defaultSettings(), QObject *parent=0) | |
Constructs a SessionStore object. More... | |
~SessionStore () | |
Destructs a SessionStore object. | |
void | resetSession (HttpServerRequest &request) const |
This method removes all cookies matching with this store's settings from request . More... | |
void | setMacSecret (const QByteArray &secret) |
Sets the secret key of the message authentication code. More... | |
Static Public Member Functions | |
static SimpleSessionStore & | defaultInstance () |
Returns a reference to the same store every time it's called. More... | |
Static Public Member Functions inherited from Tufao::SessionStore | |
static SessionSettings | defaultSettings () |
Returns the default settings, used when you don't specify the settings argument in SessionStore constructor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Tufao::SessionStore | |
QByteArray | session (const HttpServerRequest &request) const |
Returns the value of the first cookie that is compatible with this store's properties, as defined in its settings. More... | |
QByteArray | session (const HttpServerRequest &request, const HttpServerResponse &response) const |
Returns the value of the first cookie that is compatible with this store's properties, as defined in its settings. More... | |
void | setSession (HttpServerResponse &response, const QByteArray &session) const |
Sets a cookie that matches the store's settings in the response object. More... | |
void | unsetSession (HttpServerResponse &response) const |
Invalidates the user's session. More... | |
Protected Attributes inherited from Tufao::SessionStore | |
SessionSettings | settings |
This attribute represents the session's settings. More... | |
SimpleSessionStore implements a simple storage mechanism to SessionStore.
It will store the data in the system memory.
It will look for expired cookies (and delete them) at a defined interval (the default value is DEFAULT_REFRESH_INTERVAL).
|
explicit |
Constructs a new SimpleSessionStore object.
It will pass parent
to QObject constructor and settings
to SessionStore constructor.
|
static |
Returns a reference to the same store every time it's called.
It acts like a singleton.
int Tufao::SimpleSessionStore::refreshInterval | ( | ) | const |
The refresh interval used to look for (and delete) expired cookies.
The default interval is the value of the macro DEFAULT_REFRESH_INTERVAL.