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.14 date: 2021/02/24 14:56:03
user: cg
file: HTTPSession.st directory: goodies/webServer
module: stx stc-classLibrary: webServer

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:]

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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
(comment from inherited method)
return an instance of myself without indexed variables


Instance protocol:

accessing
o  at: aKey
(comment from inherited method)
return the indexed instance variable with index, anInteger;
this method can be redefined in subclasses.

o  at: aSymbol ifAbsent: anObject
(comment from inherited method)
return the indexed instance variable with index, anInteger.
If there is no such key, return the value from exceptionalValue.
This method is usually be redefined in subclasses.

o  at: aSymbol ifAbsentPut: aBlock

o  at: aSymbol ifPresent: aOneArgBlock

o  at: aKey put: aSymbol
(comment from inherited method)
store the 2nd arg, anObject as indexed instvar with index, anInteger.
this method can be redefined in subclasses. Returns anObject (sigh)

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:28:37 GMT