cutelyst 4.9.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::SessionStoreFile Class Reference

A session store that stores user sessions in the file system. More...

#include <Cutelyst/Plugins/Session/sessionstorefile.h>

Inheritance diagram for Cutelyst::SessionStoreFile:

Public Member Functions

 SessionStoreFile (QObject *parent=nullptr)
 ~SessionStoreFile ()
virtual bool deleteExpiredSessions (Context *c, quint64 expires) final
virtual bool deleteSessionData (Context *c, const QByteArray &sid, const QString &key) final
virtual QVariant getSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &defaultValue) final
virtual bool storeSessionData (Context *c, const QByteArray &sid, const QString &key, const QVariant &value) final
Public Member Functions inherited from Cutelyst::SessionStore
 SessionStore (QObject *parent=nullptr)

Detailed Description

This session store stores the session data in the file system. The data is stored in files named after the session id below a directory that is created in the system’s temporary directory and named after your application. For example /tmp/myapplication/session/data.

This is also the default session store that is used by the Session plugin if no session store has been manuall set via Session::setStorage().

Logging category
cutelyst.plugin.sessionfile
Logging with Cutelyst

Definition at line 28 of file sessionstorefile.h.

Constructor & Destructor Documentation

◆ SessionStoreFile()

SessionStoreFile::SessionStoreFile ( QObject * parent = nullptr)
explicit

Constructs a new SessionStoreFile object with the given parent.

Definition at line 26 of file sessionstorefile.cpp.

References Cutelyst::SessionStore::SessionStore().

◆ ~SessionStoreFile()

SessionStoreFile::~SessionStoreFile ( )

Destroys the SessionStoreFile object.

Definition at line 31 of file sessionstorefile.cpp.

Member Function Documentation

◆ deleteExpiredSessions()

bool SessionStoreFile::deleteExpiredSessions ( Context * c,
quint64 expires )
finalvirtual

Reimplemented from SessionStore::deleteExpiredSessions().

Implements Cutelyst::SessionStore.

Definition at line 77 of file sessionstorefile.cpp.

◆ deleteSessionData()

bool SessionStoreFile::deleteSessionData ( Context * c,
const QByteArray & sid,
const QString & key )
finalvirtual

Reimplemented from SessionStore::deleteSessionData().

Implements Cutelyst::SessionStore.

Definition at line 59 of file sessionstorefile.cpp.

References Cutelyst::Context::setStash().

◆ getSessionData()

QVariant SessionStoreFile::getSessionData ( Context * c,
const QByteArray & sid,
const QString & key,
const QVariant & defaultValue )
finalvirtual

Reimplemented from SessionStore::getSessionData().

Implements Cutelyst::SessionStore.

Definition at line 35 of file sessionstorefile.cpp.

◆ storeSessionData()

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

Reimplemented from SessionStore::storeSessionData().

Implements Cutelyst::SessionStore.

Definition at line 45 of file sessionstorefile.cpp.

References Cutelyst::Context::setStash().