Library: OSP/Web
Package: Web
Header: Poco/OSP/Web/WebSessionManager.h
A WebSessionManager manages HTTP sessions using cookies.
The SessionManager is registered under the service name "osp.web.session".
Note that the application name (appName) specified in get() and create() can contain a domain name, separated by '@'. If a domain name is given, it is used to set the domain for the session cookie. Similarly, a path can be given, beginning with a slash.
For example, if the appName is sample@.appinf.com, then the browser will send the session cookie to all hosts with names in the appinf.com domain. If a domain is not given, the session cookie will only be available to the host that has originally set it.
Direct Base Classes: WebSessionService < Poco::Net::HTTPServerRequest >
All Base Classes: WebSessionService < Poco::Net::HTTPServerRequest >
Member Functions: addCookie, cookieDomain, cookieName, cookiePath, create, createSessionId, find, get, getId, isA, remove, type
typedef Poco::AutoPtr < WebSessionManager > Ptr;
Creates the SessionManager.
Destroys the SessionManager.
WebSession::Ptr create(
const std::string & appName,
const Poco::Net::HTTPServerRequest & request,
int expireSeconds,
BundleContext::Ptr pContext
);
WebSession::Ptr find(
const std::string & appName,
const Poco::Net::HTTPServerRequest & request
);
WebSession::Ptr get(
const std::string & appName,
const Poco::Net::HTTPServerRequest & request,
int expireSeconds,
BundleContext::Ptr pContext
);
virtual bool isA(
const std::type_info & otherType
) const;
void remove(
WebSession::Ptr ptr
);
virtual const std::type_info & type() const;
void addCookie(
const std::string & appName,
const Poco::Net::HTTPServerRequest & request,
WebSession::Ptr ptrSes
);
std::string cookieDomain(
const std::string & appName
);
std::string cookieName(
const std::string & appName
);
std::string cookiePath(
const std::string & appName
);
std::string createSessionId();
std::string getId(
const std::string & appName,
const Poco::Net::HTTPServerRequest & request
);
static const std::string SERVICE_NAME;