Cutelyst  1.12.0
Public Member Functions | Public Attributes | List of all members
Cutelyst::SessionStoreMemcached Class Reference

Memcached session store. More...

#include <sessionstorememcached.h>

Inheritance diagram for Cutelyst::SessionStoreMemcached:
Inheritance graph
[legend]

Public Member Functions

 ~SessionStoreMemcached ()
 Deconstructs the SessionStoreMemcached object.
 
virtual bool deleteExpiredSessions (Context *c, quint64 expires) final
 
virtual bool deleteSessionData (Context *c, const QString &sid, const QString &key) final
 
virtual QVariant getSessionData (Context *c, const QString &sid, const QString &key, const QVariant &defaultValue) final
 
 Q_DECL_DEPRECATED_X ("Use MemcachedSessionStore plugin instead.") explicit SessionStoreMemcached(QObject *parent
 Constructs a default SessionStoreMemcached object with given parent. More...
 
 Q_DECL_DEPRECATED_X ("Use MemcachedSessionStore plugin instead.") SessionStoreMemcached(const QString &config
 Constructs a SessionStoreMemcached object with given config and parent. More...
 
virtual bool storeSessionData (Context *c, const QString &sid, const QString &key, const QVariant &value) final
 
- Public Member Functions inherited from Cutelyst::SessionStore
 SessionStore (QObject *parent=nullptr)
 

Public Attributes

QObject * parent
 

Detailed Description

This session store saves session data to a Memcached server using libMemcached.

This is completely optional. To build it, you need pkg-config and libMemcached >= 1.0.10 in your build environment. If pkg-config and libMemcached can not be found, this session store will be silently disabled and not be build.

Deprecated:
This class is deprecated. Use the new MemcachedSessionStore plugin instead.
Usage example with custom configuration
#include <Cutelyst/Plugins/Session/Session>
#include <Cutelyst/Plugins/Session/sessionstorememcached.h>
bool MyCutelystApp::init()
{
// other initialization stuff
// ...
auto session = new Session(this);
sess->setStorage(new SessionStoreMemcached(QStringLiteral("--SOCKET=\"/var/run/memcached/memcached.sock\"")));
// maybe more initialization stuff
// ...
}

Definition at line 59 of file sessionstorememcached.h.

Member Function Documentation

bool SessionStoreMemcached::deleteExpiredSessions ( Context c,
quint64  expires 
)
finalvirtual

Reimplemented from SessionStore::deleteExpiredSessions().

Implements Cutelyst::SessionStore.

Definition at line 81 of file sessionstorememcached.cpp.

References Cutelyst::Context::error().

bool SessionStoreMemcached::deleteSessionData ( Context c,
const QString &  sid,
const QString &  key 
)
finalvirtual

Reimplemented from SessionStore::deleteSessionData().

Implements Cutelyst::SessionStore.

Definition at line 70 of file sessionstorememcached.cpp.

QVariant SessionStoreMemcached::getSessionData ( Context c,
const QString &  sid,
const QString &  key,
const QVariant &  defaultValue 
)
finalvirtual

Reimplemented from SessionStore::getSessionData().

Implements Cutelyst::SessionStore.

Definition at line 52 of file sessionstorememcached.cpp.

Cutelyst::SessionStoreMemcached::Q_DECL_DEPRECATED_X ( "Use MemcachedSessionStore plugin instead."  )

This default created session store will connect to the memcached server running on localhost port 11211.

Cutelyst::SessionStoreMemcached::Q_DECL_DEPRECATED_X ( "Use MemcachedSessionStore plugin instead."  ) const

Use the config string as described by the libmemcached documentation to construct a SessionStoreMemcached object with more specific configuration.

bool SessionStoreMemcached::storeSessionData ( Context c,
const QString &  sid,
const QString &  key,
const QVariant &  value 
)
finalvirtual

Reimplemented from SessionStore::storeSessionData().

Implements Cutelyst::SessionStore.

Definition at line 59 of file sessionstorememcached.cpp.