Poco::OSP::Web

template < class Request >

class WebSessionService

File Information

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

Description

A WebSessionService manages WebSession objects.

How an implementation of the WebSessionService actually associates WebSession objects with user sessions in a web browser is up to the implementation. A typical way to do this would be to set a cookie referencing the WebSession in the user's web browser.

Sessions are always associated with a certain application. This allows for different applications running in one OSP container to each have their own session object.

Application names should follow the usual OSP reverse-DNS naming schema. Specifying an empty application name is valid.

Inheritance

Direct Base Classes: Poco::OSP::Service

All Base Classes: Poco::OSP::Service, Poco::RefCountedObject

Member Summary

Member Functions: create, find, get, isA, remove, removeForUser, type

Inherited Functions: duplicate, isA, referenceCount, release, type

Constructors

WebSessionService protected inline

WebSessionService();

Destructor

~WebSessionService protected virtual inline

~WebSessionService();

Member Functions

create virtual

virtual WebSession::Ptr create(
    const std::string & appName,
    const Request & request,
    int expireSeconds,
    BundleContext::Ptr pContext
) = 0;

Creates a new WebSession object with the given expiration time for the application given by appName and the given HTTP request, and associates the WebSession with the browser's user session.

find virtual

virtual WebSession::Ptr find(
    const std::string & appName,
    const Request & request
) = 0;

Return a WebSession object for the application specified by appName and the given HTTP request if one exists, or a null pointer otherwise.

get virtual

virtual WebSession::Ptr get(
    const std::string & appName,
    const Request & request,
    int expireSeconds,
    BundleContext::Ptr pContext
) = 0;

Return a WebSession object for the application specified by appName and the given HTTP request. If no session is associated with the given request, a new session is created with the given expiration time.

isA virtual inline

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

remove virtual

virtual void remove(
    WebSession::Ptr ptr
) = 0;

Removes a session from the manager, if it exists. Does nothing if the session is not known to the session manager.

removeForUser virtual

virtual void removeForUser(
    const std::string & username
) = 0;

Removes all sessions for the given username.

type virtual inline

const std::type_info & type() const;