CppCMS
Public Member Functions
cppcms::session_api Class Reference

This class represents the most generic implementation of session storage device. More...

#include <cppcms/session_api.h>

Inheritance diagram for cppcms::session_api:
booster::noncopyable cppcms::sessions::session_cookies cppcms::sessions::session_dual cppcms::sessions::session_sid

List of all members.

Public Member Functions

virtual void save (session_interface &iface, std::string const &data, time_t timeout, bool new_data, bool on_server)=0
virtual bool load (session_interface &iface, std::string &data, time_t &timeout)=0
virtual void clear (session_interface &iface)=0
virtual bool is_blocking ()=0
virtual ~session_api ()

Detailed Description

This class represents the most generic implementation of session storage device.

This classes are created using session_api_factory and are designed to be reimplemented by users to provide an additional backends.

This class is most generic that does not provide any goodies with exception of setting or getting session cookie, the user should generally take a look on sessions::session_storage or sessions::encryptor for easier implementation of session storage

Note: these objects must be thread safe.


Constructor & Destructor Documentation

virtual cppcms::session_api::~session_api ( ) [inline, virtual]

Destructor


Member Function Documentation

virtual void cppcms::session_api::clear ( session_interface iface) [pure virtual]

Remove the session object

Parameters:
iface- the session_interface object that allows read and set session cookie

Implemented in cppcms::sessions::session_cookies, cppcms::sessions::session_dual, and cppcms::sessions::session_sid.

virtual bool cppcms::session_api::is_blocking ( ) [pure virtual]

Return true if the session store or save operations are blocking or very cpu intensive

Implemented in cppcms::sessions::session_cookies, cppcms::sessions::session_dual, and cppcms::sessions::session_sid.

virtual bool cppcms::session_api::load ( session_interface iface,
std::string &  data,
time_t &  timeout 
) [pure virtual]

Load session's data

Parameters:
iface- the session_interface object that allows read and set session cookie
data- the string that should be filled with session data
timeout- the expiration time of this session object
Returns:
true of session was loaded, false otherwise

Implemented in cppcms::sessions::session_cookies, cppcms::sessions::session_dual, and cppcms::sessions::session_sid.

virtual void cppcms::session_api::save ( session_interface iface,
std::string const &  data,
time_t  timeout,
bool  new_data,
bool  on_server 
) [pure virtual]

Save session's data:

Parameters:
iface- the session_interface object that allows set session cookie
data- the data that should be stored in the session
timeout- the absolute expiration POSIX time
new_data- flag that marks that new session object should be created regardless of current cookie value
on_server- flag that marks that the data must be stored on the server and not in cookies only

Implemented in cppcms::sessions::session_cookies, cppcms::sessions::session_dual, and cppcms::sessions::session_sid.


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