![]() |
cutelyst 4.8.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Memcached based session store. More...
#include <Cutelyst/Pugins/MemcachedSessionStore/MemcachedSessionStore>

Public Member Functions | |
| MemcachedSessionStore (Application *app, QObject *parent=nullptr) | |
| ~MemcachedSessionStore () override | |
| bool | deleteExpiredSessions (Context *c, quint64 expires) override |
| bool | deleteSessionData (Context *c, const QByteArray &sid, const QString &key) override |
| QVariant | getSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &defaultValue) override |
| void | setGroupKey (const QByteArray &groupKey) |
| bool | storeSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &value) override |
Public Member Functions inherited from Cutelyst::SessionStore | |
| SessionStore (QObject *parent=nullptr) | |
| virtual bool | deleteExpiredSessions (Context *c, quint64 expires)=0 |
| virtual bool | deleteSessionData (Context *c, const QByteArray &sid, const QString &key)=0 |
| virtual QVariant | getSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &defaultValue=QVariant())=0 |
| virtual bool | storeSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &value)=0 |
This session store saves session data to Memcached servers using the Memcached plugin.
The MemcachedSessionStore plugin can be configured in the application configuration file in the Cutelyst_MemcachedSessionStore_Plugin section:
Type: string
Default: empty
Sets an optional group key to store the data on a specific server.
To build this plugin you need the development and header files for libmemcached and have to enable the Memcached plugin. If the Memcached plugin is enabled, the MemcachedSessionStore plugin will be enabled automatically, too. To disable the build of the MemcachedSessionStore plugin, run cmake with -DPLUGIN_MEMCACHEDSESSIONSTORE:BOOL=OFF.
Definition at line 77 of file memcachedsessionstore.h.
| MemcachedSessionStore::MemcachedSessionStore | ( | Cutelyst::Application * | app, |
| QObject * | parent = nullptr |
||
| ) |
Constructs a new MemcachedSessionStore object with the given parent and app. The pointer to the Application object is used to load the plugin configuration from the configuration file section Cutelyst_MemcachedSessionStore_Plugin.
Definition at line 27 of file memcachedsessionstore.cpp.
References Cutelyst::Engine::config(), and Cutelyst::Application::engine().
|
overridedefault |
Deconstructs the MemcachedSessionStore object
|
overridevirtual |
Removes all expired sessions which are above expires.
Implements Cutelyst::SessionStore.
Definition at line 78 of file memcachedsessionstore.cpp.
|
overridevirtual |
Removes all session data for the given session id sid and key.
Implements Cutelyst::SessionStore.
Definition at line 67 of file memcachedsessionstore.cpp.
References Cutelyst::Context::setStash().
|
overridevirtual |
Returns the session data for the given session id sid and key, if key does not exist returns defaultValue.
Implements Cutelyst::SessionStore.
Definition at line 41 of file memcachedsessionstore.cpp.
| void MemcachedSessionStore::setGroupKey | ( | const QByteArray & | groupKey | ) |
Sets the groupKey to define the servers to store the sessions on. This can also be set in the configuration file.
Definition at line 86 of file memcachedsessionstore.cpp.
|
overridevirtual |
Stores the session data for the given session id sid and key to value.
Implements Cutelyst::SessionStore.
Definition at line 53 of file memcachedsessionstore.cpp.
References Cutelyst::Context::setStash().