NCBI C++ ToolKit
|
Search Toolkit Book for CCgiSession
#include <cgi/cgi_session.hpp>
Public Types | |
enum | EStatus { eNew , eLoaded , eNotLoaded , eDeleted , eImplNotSet } |
Session status. More... | |
enum | ECookieSupport { eUseCookie , eNoCookie } |
Specifies if a client session cookie can be used to transfer session id between requests. More... | |
typedef list< string > | TNames |
Public Member Functions | |
CCgiSession (const CCgiRequest &request, ICgiSessionStorage *impl, EOwnership impl_ownership=eTakeOwnership, ECookieSupport cookie_support=eUseCookie) | |
~CCgiSession () | |
const string & | GetId (void) const |
Get session ID. More... | |
void | SetId (const string &session_id) |
Set session ID. More... | |
void | ModifyId (const string &new_session_id) |
Modify session ID. More... | |
void | Load (void) |
Load the session. More... | |
void | CreateNewSession (void) |
Create new session. More... | |
TNames | GetAttributeNames (void) const |
Retrieve names of all attributes attached to this session. More... | |
CNcbiIstream & | GetAttrIStream (const string &name, size_t *size=NULL) |
Get input stream to read an attribute's data from. More... | |
CNcbiOstream & | GetAttrOStream (const string &name) |
Get output stream to write an attribute's data to. More... | |
void | SetAttribute (const string &name, const string &value) |
Set attribute data as a string. More... | |
string | GetAttribute (const string &name) const |
Get attribute data as string. More... | |
void | RemoveAttribute (const string &name) |
Remove attribute from the session. More... | |
void | DeleteSession (void) |
Delete current session. More... | |
EStatus | GetStatus (void) const |
Get current status of the session. More... | |
bool | Exists (void) const |
Check if this session object is valid. More... | |
const string & | GetSessionIdName (void) const |
Get name for session ID. More... | |
void | SetSessionIdName (const string &name) |
Set name for session ID. More... | |
void | SetSessionCookieDomain (const string &domain) |
Set session cookie domain. More... | |
void | SetSessionCookiePath (const string &path) |
Set session cookie path. More... | |
void | SetSessionCookieExpTime (const CTime &exp_time) |
Set session cookie expiration time. More... | |
const CCgiCookie * | GetSessionCookie (void) const |
Get a cookie pertaining to the session. More... | |
string | RetrieveSessionId () const |
Retrieve a session id from a query string or a session cookie. More... | |
Static Public Attributes | |
static const char * | kDefaultSessionIdName = "ncbi_session_data" |
static const char * | kDefaultSessionCookieDomain = ".nih.gov" |
static const char * | kDefaultSessionCookiePath = "/" |
Private Member Functions | |
void | x_Load () const |
CCgiSession (const CCgiSession &) | |
CCgiSession & | operator= (const CCgiSession &) |
Private Attributes | |
const CCgiRequest & | m_Request |
ICgiSessionStorage * | m_Impl |
unique_ptr< ICgiSessionStorage > | m_ImplGuard |
ECookieSupport | m_CookieSupport |
string | m_SessionId |
string | m_SessionIdName |
string | m_SessionCookieDomain |
string | m_SessionCookiePath |
CTime | m_SessionCookieExpTime |
unique_ptr< CCgiCookie > | m_SessionCookie |
EStatus | m_Status |
CCgiSession –.
Facilitate the transfer of session ID between Web requests. Store and retrieve the CGI session data from an external data storage using the session ID.
Definition at line 61 of file cgi_session.hpp.