C++ Web Framework  3.0
Public Member Functions | Friends | List of all members
Session Class Reference

The Session class holds information about a client session. More...

#include <session.h>

Public Member Functions

 Session (const QString &id, qint64 sessionTimeOut)
 Construct a session with a unique identifier.
 
QObject * getAttribute (const QString &name) const noexcept
 Returns a session attribute given a name. More...
 
QStringList getAttributeNames ()
 Returns a session attribute given a name.
 
qint64 getCreationTime () const noexcept
 getCreationTime
 
QString getId () const
 Returns the unique id.
 
qint64 getLastAccessedTime () const noexcept
 Returns the time of the last session access.
 
void validate ()
 Make a valid session.
 
void invalidate () noexcept
 Make a invalid session.
 
int removeAttribute (const QString &name) noexcept
 Removes all the items that have the key key from the map. Returns the number of items removed which is usually 1 but will be 0 if the key isn't in the map, or > 1 if insertMulti() has been used with the key.
 
void addAttribute (const QString &name, QObject *value) noexcept
 This method add an attribute to the session.
 
bool getAutoClearAttributes () const noexcept
 getAutoClearAttributes
 
void setAutoClearAttributes (bool value) noexcept
 setAutoClearAttributes
 
bool isExpired ()
 This method returns true if the session is expired otherwise returns false.
 
qint64 getSessionTimeOut () const noexcept
 Returns the session timeout.
 
void setSessionTimeOut (qint64 value)
 Sets the current session timeout. If value is negative then it will be configured according to sessionExpirationTime of the CPPWeb.ini file.
 

Friends

class HttpReadRequest
 
class Request
 

Detailed Description

The Session class holds information about a client session.

Member Function Documentation

◆ getAttribute()

QObject* Session::getAttribute ( const QString &  name) const
inlinenoexcept

Returns a session attribute given a name.

Warning
: If the parameter is not found, nullptr is returned.

The documentation for this class was generated from the following files: