Granada  1.54.0
Structured layer on top of C++ REST SDK for building server applications in C++. Granada implements sessions, server side plug-in framework, C++ OAuth 2.0 server, data storage access, server script running, server browsing.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
granada::http::session::RedisSession Class Reference

#include <redis_session.h>

Inheritance diagram for granada::http::session::RedisSession:
granada::http::session::Session

Public Member Functions

 RedisSession ()
 
 RedisSession (const web::http::http_request &request, web::http::http_response &response)
 
 RedisSession (const web::http::http_request &request)
 
 RedisSession (const std::string &token)
 
virtual ~RedisSession ()
 
virtual
granada::http::session::SessionRoles
roles () override
 
virtual
granada::http::session::SessionHandler
session_handler () override
 
virtual granada::Functionsclose_callbacks () override
 
- Public Member Functions inherited from granada::http::session::Session
 Session ()
 
 Session (const web::http::http_request &request, web::http::http_response &response)
 
 Session (const web::http::http_request &request)
 
 Session (const std::string &token)
 
virtual ~Session ()
 
virtual void set (const std::string token, const std::time_t update_time)
 
virtual void Open ()
 
virtual void Open (web::http::http_response &response)
 
virtual void Update ()
 
virtual void Close ()
 
virtual const bool IsTimedOut ()
 
virtual const bool IsTimedOut (const long int &extra_seconds)
 
virtual const bool IsValid ()
 
virtual const bool IsGarbage ()
 
virtual const long GetSessionTimeout ()
 
virtual void Write (const std::string &key, const std::string &value)
 
virtual const std::string Read (const std::string &key)
 
virtual void Destroy (const std::string &key)
 
virtual web::json::value to_json ()
 
virtual const std::string & GetToken ()
 
virtual void SetToken (const std::string &token)
 
virtual const std::time_t & GetUpdateTime ()
 
virtual void SetUpdateTime (const std::time_t &update_time)
 

Additional Inherited Members

- Protected Member Functions inherited from granada::http::session::Session
virtual void LoadProperties ()
 
virtual const bool LoadSession (const web::http::http_request &request, web::http::http_response &response)
 
virtual const bool LoadSession (const web::http::http_request &request)
 
virtual const bool LoadSession (const std::string &token)
 
virtual const std::string session_data_hash ()
 
virtual const std::string & token_label ()
 
virtual const std::string & application_session_token_support ()
 
virtual const long & application_session_timeout ()
 
virtual const long & session_garbage_extra_timeout ()
 
- Protected Attributes inherited from granada::http::session::Session
std::string session_token_support_
 
std::string token_
 
std::time_t update_time_
 
- Static Protected Attributes inherited from granada::http::session::Session
static std::vector< std::string > DEFAULT_SESSIONS_TOKEN_SUPPORT
 
static std::mutex session_exists_mtx_
 
static std::string token_label_
 
static std::string application_session_token_support_
 
static long application_session_timeout_
 
static long session_garbage_extra_timeout_
 

Constructor & Destructor Documentation

granada::http::session::RedisSession::RedisSession ( )

Constructor

granada::http::session::RedisSession::RedisSession ( const web::http::http_request &  request,
web::http::http_response &  response 
)

Constructor. Loads session. Retrieves the token of the session from the HTTP request and loads a session using the session handler. If session does not exist or token is not found a new session is created. This constructor is recommended for sessions that store token in cookie

Parameters
requestHttp request.
responseHttp response.
granada::http::session::RedisSession::RedisSession ( const web::http::http_request &  request)

Constructor. Loads session. Retrieves the token of the session from the HTTP request and loads a session using the session handler. If session does not exist or token is not found a new session is created. This constructor is recommended for sessions that use get and post values.

Parameters
requestHttp request.
granada::http::session::RedisSession::RedisSession ( const std::string &  token)

Constructor. Loads a session with the given token using the session handler. Use this loader if you have the token and you are not using cookies.

Parameters
tokenSession token.
virtual granada::http::session::RedisSession::~RedisSession ( )
inlinevirtual

Destructor

Member Function Documentation

virtual granada::Functions* granada::http::session::RedisSession::close_callbacks ( )
inlineoverridevirtual

Returns a pointer to the collection of functions that are called when closing the session.

Returns
Pointer to the collection of functions that are called when session is closed.

Reimplemented from granada::http::session::Session.

virtual granada::http::session::SessionRoles* granada::http::session::RedisSession::roles ( )
inlineoverridevirtual

Returns a pointer to the roles of a session.

Returns
Pointer to the roles of the session.

Reimplemented from granada::http::session::Session.

virtual granada::http::session::SessionHandler* granada::http::session::RedisSession::session_handler ( )
inlineoverridevirtual

Returns the pointer of Session Handler that manages the session.

Returns
Session Handler.

Reimplemented from granada::http::session::Session.


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