ofxHTTP
A collection of tools for HTTP.
|
A client cookie-based session store for servers. More...
#include <Session.h>
Public Member Functions | |
SimpleSession (const std::string &sessionId=generateId()) | |
bool | has (const std::string &key) const override |
Check to see if the provided key exists in the session data. More... | |
void | put (const std::string &key, const std::string &value) override |
Add (or replace) a key in the sesion data with the given value. More... | |
std::string | get (const std::string &key, const std::string &defaultValue) const override |
Get the session data for a given key, or a default value. More... | |
std::string | get (const std::string &key) const override |
Get the session data for a given key, or throw an exception. More... | |
void | remove (const std::string &key) override |
Remove a key / value pair. More... | |
void | clear () override |
Remove all data from the session. | |
Public Member Functions inherited from ofx::HTTP::BaseSession | |
BaseSession (const std::string sessionId=generateId()) | |
std::string | getId () const override |
Get the session id. More... | |
Public Member Functions inherited from ofx::HTTP::AbstractSession | |
virtual | ~AbstractSession () |
Destroy the AbstractSession. | |
Protected Member Functions | |
SimpleSession (const SimpleSession &) | |
SimpleSession & | operator= (const SimpleSession &) |
Protected Member Functions inherited from ofx::HTTP::BaseSession | |
BaseSession (const BaseSession &) | |
BaseSession & | operator= (const BaseSession &) |
Protected Attributes | |
std::map< std::string, std::string > | _sessionDict |
Protected Attributes inherited from ofx::HTTP::BaseSession | |
std::string | _sessionId |
std::mutex | _mutex |
Additional Inherited Members | |
Static Public Member Functions inherited from ofx::HTTP::BaseSession | |
static std::string | generateId () |
A utility function for generating unique session ids. More... | |
Static Public Attributes inherited from ofx::HTTP::BaseSession | |
static const std::string | KEY_LAST_MODIFIED = "last_modified" |
A client cookie-based session store for servers.
Client sessions are tracked via cookie. Server routes can access the session store and associate any information with the client's session.
|
overridevirtual |
Get the session data for a given key, or a default value.
key | The data key to get. |
defaultValue | The data value to return if the key does not exist. |
Implements ofx::HTTP::AbstractSession.
|
overridevirtual |
Get the session data for a given key, or throw an exception.
key | The data key to get. |
Poco::InvalidAccessException | if key does not exist. |
Implements ofx::HTTP::AbstractSession.
|
overridevirtual |
Check to see if the provided key exists in the session data.
key | The data key to check. |
Implements ofx::HTTP::AbstractSession.
|
overridevirtual |
Add (or replace) a key in the sesion data with the given value.
key | The data key to add. |
value | The data value to add for the given key. |
Implements ofx::HTTP::AbstractSession.
|
overridevirtual |