NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
CCgiSession Class Reference

Search Toolkit Book for CCgiSession

CCgiSession –. More...

#include <cgi/cgi_session.hpp>

+ Collaboration diagram for CCgiSession:

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< stringTNames
 

Public Member Functions

 CCgiSession (const CCgiRequest &request, ICgiSessionStorage *impl, EOwnership impl_ownership=eTakeOwnership, ECookieSupport cookie_support=eUseCookie)
 
 ~CCgiSession ()
 
const stringGetId (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...
 
CNcbiIstreamGetAttrIStream (const string &name, size_t *size=NULL)
 Get input stream to read an attribute's data from. More...
 
CNcbiOstreamGetAttrOStream (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 stringGetSessionIdName (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 CCgiCookieGetSessionCookie (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 &)
 
CCgiSessionoperator= (const CCgiSession &)
 

Private Attributes

const CCgiRequestm_Request
 
ICgiSessionStoragem_Impl
 
unique_ptr< ICgiSessionStoragem_ImplGuard
 
ECookieSupport m_CookieSupport
 
string m_SessionId
 
string m_SessionIdName
 
string m_SessionCookieDomain
 
string m_SessionCookiePath
 
CTime m_SessionCookieExpTime
 
unique_ptr< CCgiCookiem_SessionCookie
 
EStatus m_Status
 

Detailed Description

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.


The documentation for this class was generated from the following files:
Modified on Wed May 15 15:04:08 2024 by modify_doxy.py rev. 669887