ofxHTTP
A collection of tools for HTTP.
|
Public Member Functions | |
BaseSessionStore (const std::string &sessionKeyName) | |
AbstractSession & | getSession (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) |
Get a valid session for the given request. More... | |
void | destroySession (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) |
Destroy the session(s) associated with the given exchange. More... | |
Public Member Functions inherited from ofx::HTTP::AbstractSessionStore | |
virtual | ~AbstractSessionStore () |
Destroy the AbstractSessionStore. | |
Static Public Attributes | |
static const std::string | DEFAULT_SESSION_KEY_NAME = "session_key" |
Protected Member Functions | |
virtual bool | hasSession (const std::string &sessionId) const =0 |
Query if the store has the the given session. More... | |
virtual AbstractSession & | getSession (const std::string &sessionId)=0 |
Get a session by sesssionId . More... | |
virtual AbstractSession & | createSession ()=0 |
Create a completely new session. More... | |
virtual void | destroySession (const std::string &sessionId)=0 |
Destroy the record of a session by its session id. More... | |
Protected Attributes | |
const std::string | _sessionKeyName |
|
protectedpure virtual |
Create a completely new session.
Since this returns a reference, the newly created session must be stored outside of the local method scope so the reference does not become invalid.
Implements ofx::HTTP::AbstractSessionStore.
Implemented in ofx::HTTP::SimpleSessionStore.
|
virtual |
Destroy the session(s) associated with the given exchange.
This method will invalidate any session cookies in the response header. If session data does not exist, the method will return quietly.
Implements ofx::HTTP::AbstractSessionStore.
|
protectedpure virtual |
Destroy the record of a session by its session id.
If session data does not exist, the method will return quietly.
sessionId | The id of the session to destroy. |
Implements ofx::HTTP::AbstractSessionStore.
Implemented in ofx::HTTP::SimpleSessionStore.
|
virtual |
Get a valid session for the given request.
This method is guaranteed to provide a valid session the session created will expire when teh browser window is closed. Other method will be able to update the cookie in the response headers if more speific cookie parameters are desired.
This method will also ensure that only one session id is availble at a given time
Implements ofx::HTTP::AbstractSessionStore.
|
protectedpure virtual |
Get a session by sesssionId
.
sessionId | The id of the session to get. |
Poco::InvalidAccessException | if no session is found. |
Implements ofx::HTTP::AbstractSessionStore.
Implemented in ofx::HTTP::SimpleSessionStore.
|
protectedpure virtual |
Query if the store has the the given session.
sessionId | The id of the session to query. |
Implements ofx::HTTP::AbstractSessionStore.
Implemented in ofx::HTTP::SimpleSessionStore.