ofxHTTP
A collection of tools for HTTP.
|
An abstract class representing a session store. More...
#include <AbstractServerTypes.h>
Public Member Functions | |
virtual | ~AbstractSessionStore () |
Destroy the AbstractSessionStore. | |
virtual AbstractSession & | getSession (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response)=0 |
Get a valid session for the given request. More... | |
virtual void | destroySession (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response)=0 |
Destroy the session(s) associated with the given exchange. More... | |
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... | |
An abstract class representing a session store.
A session store is responsible for establishing browsing sessions. This includes but is not limited to sessions created using HTTP cookies.
|
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.
Implemented in ofx::HTTP::SimpleSessionStore, and ofx::HTTP::BaseSessionStore.
|
pure 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.
Implemented in ofx::HTTP::BaseSessionStore.
|
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. |
Implemented in ofx::HTTP::SimpleSessionStore, and ofx::HTTP::BaseSessionStore.
|
pure 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
Implemented in ofx::HTTP::BaseSessionStore.
|
protectedpure virtual |
Get a session by sesssionId
.
sessionId | The id of the session to get. |
Poco::InvalidAccessException | if no session is found. |
Implemented in ofx::HTTP::SimpleSessionStore, and ofx::HTTP::BaseSessionStore.
|
protectedpure virtual |
Query if the store has the the given session.
sessionId | The id of the session to query. |
Implemented in ofx::HTTP::SimpleSessionStore, and ofx::HTTP::BaseSessionStore.