Cutelyst  1.5.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Cutelyst::Session Class Reference
Inheritance diagram for Cutelyst::Session:
Inheritance graph

Public Member Functions

 Session (Application *parent)
void setStorage (SessionStore *store)
virtual bool setup (Application *app) final
SessionStorestorage () const
- Public Member Functions inherited from Cutelyst::Plugin
 Plugin (Application *parent)

Static Public Member Functions

static void changeExpires (Context *c, quint64 expires)
static QString deleteReason (Context *c)
static void deleteSession (Context *c, const QString &reason=QString())
static void deleteValue (Context *c, const QString &key)
static void deleteValues (Context *c, const QStringList &keys)
static quint64 expires (Context *c)
static QString id (Context *c)
static bool isValid (Context *c)
static void setValue (Context *c, const QString &key, const QVariant &value)
static QVariant value (Context *c, const QString &key, const QVariant &defaultValue=QVariant())

Protected Attributes

SessionPrivate * d_ptr

Detailed Description

Definition at line 43 of file session.h.

Member Function Documentation

static void Cutelyst::Session::changeExpires ( Context c,
quint64  expires 

change the session expiration time for this session

Note that this only works to set the session longer than the config setting.

static QString Cutelyst::Session::deleteReason ( Context c)

This method contains a string with the reason a session was deleted. Possible values include:

  • session expired
  • address mismatch
  • user agent mismatch
static void Cutelyst::Session::deleteSession ( Context c,
const QString &  reason = QString() 

This method is used to invalidate a session. It takes an optional parameter which will be saved in deleteReason if provided.

NOTE: This method will also delete your flash data.

static quint64 Cutelyst::Session::expires ( Context c)

This method returns the time when the current session will expire, or 0 if there is no current session. If there is a session and it already expired, it will delete the session and return 0 as well.

static QString Cutelyst::Session::id ( Context c)

Returns the current session id or null if there is no current session

virtual bool Cutelyst::Session::setup ( Application app)

If config has [Plugin_Session] expires = 1234 it will change de default expires which is 7200 (two hours)

Reimplemented from Cutelyst::Plugin.