Poco::OSP::Web

class WebSessionManager

Library: OSP/Web
Package: Web
Header: Poco/OSP/Web/WebSessionManager.h

Description

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.

Inheritance

Direct Base Classes: WebSessionService < Poco::Net::HTTPServerRequest >

All Base Classes: WebSessionService < Poco::Net::HTTPServerRequest >

Member Summary

Member Functions: addCookie, cookieDomain, cookieName, cookiePath, create, createSessionId, find, get, getId, isA, remove, type

Types

Ptr

typedef Poco::AutoPtr < WebSessionManager > Ptr;

Constructors

WebSessionManager

WebSessionManager();

Creates the SessionManager.

Destructor

~WebSessionManager

~WebSessionManager();

Destroys the SessionManager.

Member Functions

create

WebSession::Ptr create(
    const std::string & appName,
    const Poco::Net::HTTPServerRequest & request,
    int expireSeconds,
    BundleContext::Ptr pContext
);

find

WebSession::Ptr find(
    const std::string & appName,
    const Poco::Net::HTTPServerRequest & request
);

get

WebSession::Ptr get(
    const std::string & appName,
    const Poco::Net::HTTPServerRequest & request,
    int expireSeconds,
    BundleContext::Ptr pContext
);

isA virtual

virtual bool isA(
    const std::type_info & otherType
) const;

remove

void remove(
    WebSession::Ptr ptr
);

type virtual

virtual const std::type_info & type() const;

addCookie protected

void addCookie(
    const std::string & appName,
    const Poco::Net::HTTPServerRequest & request,
    WebSession::Ptr ptrSes
);

cookieDomain protected

std::string cookieDomain(
    const std::string & appName
);

cookieName protected

std::string cookieName(
    const std::string & appName
);

cookiePath protected

std::string cookiePath(
    const std::string & appName
);

createSessionId protected

std::string createSessionId();

getId protected

std::string getId(
    const std::string & appName,
    const Poco::Net::HTTPServerRequest & request
);

Variables

SERVICE_NAME static

static const std::string SERVICE_NAME;