eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPSession':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HTTPSession


Inheritance:

   Object
   |
   +--HTTPSession

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Server
Version:
rev: 1.12 date: 2010/02/02 11:12:41
user: cg
file: HTTPSession.st directory: goodies/webServer
module: stx stc-classLibrary: webServer
Author:
James (james@kokxnix)

Description:


Summary:

This class provides a way to store state across multiple page requests. It is achieved through
the use of a 'session cookie' that is transported between the client and the server. The cookie's
value uniquely identifes a session (this value is generated from via the UUID class) and provides 
a Dictionary like interface to access the state associated with the session.

The state itself is stored in a Dictionary in the HTTPServer. Every hour a job
is run that removes all the sessions that have timed-out. This happens when there has
been no closure to a session. Sessions can also be removed explicitly.

Limitations:

As yet there is no support for URL rewrite functionality.


[instance variables:]

[class variables:]


Related information:



Class protocol:

constants
o  defaultMaxInactiveInterval
how long may a session be inactive until it is removed

instance creation
o  cookie: aHTTPCookie server: aHTTPServer
Checks the HTTP server if a HTTP session has been created with the same
id as the cookie sent. If so return this session with the cookie in hand
(the expiration could have changed)

<return: HTTPSession>

o  new


Instance protocol:

accessing
o  at: aKey

o  at: aSymbol ifAbsent: anObject

o  at: aSymbol ifAbsentPut: aBlock

o  at: aSymbol ifPresent: aOneArgBlock

o  at: aKey put: aSymbol

o  cookie

o  cookie: something

o  cookie: cookieArg server: serverArg

o  expiration

o  isNew

o  lastAccessedTime

o  lastAccessedTime: something

o  removeKey: aKey

actions
o  invalidate
Invalidates the session and any object bound to it

o  makeActive
The session has been accepted by the client

initialization
o  initialize
seconds

jsp-specific api
o  getAttributeNames
<return: OrderedCollection>

o  getId
Returns the id of the session which is the value of the cookie

<return: String>

o  getLastAccessedTime
<return: Timestamp>

o  getMaxInactiveInterval
Returns the maximum time interval that the this session will be alive for

<return: Time>

o  removeAttribute: aString

o  setAttribute: aString to: anObject

o  setMaxInactiveInterval: aValue
Sets the maximum time interval that the this session will be alive for in SECONDS

queries
o  isValid
Return true if the session is a valid session
<return: Boolean>



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 19 Mar 2024 11:36:32 GMT