1 #ifndef CGI___SESSION__HPP
2 #define CGI___SESSION__HPP
90 ECookieSupport cookie_support = eUseCookie);
97 const string&
GetId(
void)
const;
101 void SetId(
const string& session_id);
105 void ModifyId(
const string& new_session_id);
114 void CreateNewSession(
void);
118 TNames GetAttributeNames(
void)
const;
146 void SetAttribute(
const string& name,
const string&
value);
161 string GetAttribute(
const string& name)
const;
167 void RemoveAttribute(
const string& name);
171 void DeleteSession(
void);
180 bool Exists(
void)
const;
184 const string& GetSessionIdName(
void)
const;
188 void SetSessionIdName(
const string& name);
192 void SetSessionCookieDomain(
const string& domain);
196 void SetSessionCookiePath(
const string& path);
199 void SetSessionCookieExpTime(
const CTime& exp_time);
206 const CCgiCookie* GetSessionCookie(
void)
const;
209 string RetrieveSessionId()
const;
284 size_t*
size = 0) = 0;
Include a standard set of the NCBI C++ Toolkit most basic headers.
@ eTakeOwnership
An object can take ownership of another.
void SetSessionIdName(const string &name)
Set name for session ID.
CTime m_SessionCookieExpTime
static const char * kDefaultSessionCookieDomain
static const char * kDefaultSessionIdName
bool Exists(void) const
Check if this session object is valid.
CCgiSession::TNames TNames
ECookieSupport
Specifies if a client session cookie can be used to transfer session id between requests.
unique_ptr< CCgiCookie > m_SessionCookie
virtual void Reset()=0
Reset the session.
CCgiSession(const CCgiSession &)
void SetSessionCookieDomain(const string &domain)
Set session cookie domain.
ECookieSupport m_CookieSupport
static const char * kDefaultSessionCookiePath
const string & GetSessionIdName(void) const
Get name for session ID.
virtual void ModifySessionId(const string &new_id)=0
Modify session id.
virtual bool LoadSession(const string &sessionid)=0
Load the session The implementations must handle binary data correctly (e.g.
virtual CNcbiIstream & GetAttrIStream(const string &name, size_t *size=0)=0
Get input stream to read an attribute's data from.
virtual string GetAttribute(const string &name) const =0
Get attribute data as string.
void SetSessionCookiePath(const string &path)
Set session cookie path.
virtual string CreateNewSession()=0
Create a new empty session.
virtual void RemoveAttribute(const string &name)=0
Remove attribute from the session.
virtual void DeleteSession()=0
Delete current session.
virtual TNames GetAttributeNames(void) const =0
Retrieve names of all attributes attached to this session.
unique_ptr< ICgiSessionStorage > m_ImplGuard
string m_SessionCookiePath
const CCgiRequest & m_Request
void SetSessionCookieExpTime(const CTime &exp_time)
Set session cookie expiration time.
ICgiSessionStorage * m_Impl
virtual CNcbiOstream & GetAttrOStream(const string &name)=0
Get output stream to write an attribute's data to.
string m_SessionCookieDomain
EStatus GetStatus(void) const
Get current status of the session.
virtual void SetAttribute(const string &name, const string &value)=0
Set attribute data as a string.
CCgiSession & operator=(const CCgiSession &)
@ eUseCookie
A session cookie will be added to the response.
@ eLoaded
The session is loaded.
@ eDeleted
The session is deleted.
@ eNew
The session has just been created.
@ eNotLoaded
The session has not been loaded yet.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value