<?xml version="1.0" encoding="iso-8859-1"?>
<module name="Ft.Server.Server.Http.Session" file="/work/a/ports/textproc/py-4suite/work/4Suite-1.0b1/build/lib.freebsd-7.1-RELEASE-i386-2.4/Ft/Server/Server/Http/Session.py">
  <modification-date>2003-10-04 03:40:52</modification-date>
  <abstract>HTTP session management.  Inspired by the Java Servlet API at:
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/package-summary.html
(particularly javax.servlet.http.HttpSession)</abstract>
  <description>Copyright 2002,2003 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/</description>
  <classes>
    <class name="CookieSession" public="yes">
      <bases>
        <base documented="yes" class="Session" module="Ft.Server.Server.Http.Session"/>
      </bases>
      <abstract>An implmentation of the Session object that uses HTTP cookies, as
described in http://home.netscape.com/newsref/std/cookie_spec.html
(Netscape cookies) and http://www.faqs.org/rfcs/rfc2109.html
(standard cookies)</abstract>
      <description/>
      <method-resolution-order>
        <base name="CookieSession" module="Ft.Server.Server.Http.Session"/>
        <base name="Session" module="Ft.Server.Server.Http.Session"/>
      </method-resolution-order>
      <methods documented="yes" class="CookieSession" module="Ft.Server.Server.Http.Session" inherited="no">
        <method public="no" name="__init__" id="CookieSession-__init__">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
          <overrides name="Session" module="Ft.Server.Server.Http.Session"/>
        </method>
        <method public="yes" name="create" id="CookieSession-create">
          <abstract>Does whatever initialization can be done once the session ID is known.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="sid"/>
          </arguments>
          <overrides name="Session" module="Ft.Server.Server.Http.Session"/>
        </method>
        <method public="yes" name="getSessionId" id="CookieSession-getSessionId">
          <abstract>Attempts to get the session id from the Cookie Header.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="args"/>
            <arg name="headers"/>
            <arg name="logger"/>
          </arguments>
          <overrides name="Session" module="Ft.Server.Server.Http.Session"/>
        </method>
        <method public="yes" name="updateHeaders" id="CookieSession-updateHeaders">
          <abstract>Updates the response headers to reflect the current session info.
repo - repository instance for getting expiration info for the current session
headers - dictionary to be updated with cookie headers
logger - destination for logged remarks</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="repo"/>
            <arg name="headers"/>
            <arg name="logger"/>
          </arguments>
          <overrides name="Session" module="Ft.Server.Server.Http.Session"/>
        </method>
      </methods>
      <fields documented="yes" class="CookieSession" module="Ft.Server.Server.Http.Session" inherited="no">
        <field public="yes" name="COOKIE_HEADER" id="CookieSession-COOKIE_HEADER">
          <value>'Set-Cookie'</value>
        </field>
        <field public="yes" name="SESSION_KEY" id="CookieSession-SESSION_KEY">
          <value>'sessionId'</value>
        </field>
      </fields>
      <methods documented="yes" class="Session" module="Ft.Server.Server.Http.Session" inherited="yes">
        <member-reference name="updateBody" public="yes"/>
      </methods>
    </class>
    <class name="Session" public="yes">
      <bases>
      </bases>
      <abstract>Representation of a stateful session for use with HTTP requests and responses,
as described in RFC 2965.</abstract>
      <description>Exposes attribute &quot;id&quot;, which must be a unique id in string form.

Currently, the deprecated but widely-used Netscape cookie mechanism is
employed, plus as much of RFC 2109 as is practical, rather than the more
featureful, standardized Cookie2 mechanism advocated by RFC 2965. If
cookies are not able to be used, a framework is in place for using URL
rewriting; however the implementation is incomplete.

The userAgentVariables member is a dictionary of additional stuff
to be held in the session persistence mechanism *independently* of
the repository  session data.  Use very sparingly, and only for data
that is not affected by user taint

References:
   http://home.netscape.com/newsref/std/cookie_spec.html  (Netscape cookies)
   http://www.faqs.org/rfcs/rfc2109.html  (standard cookies)
   http://www.faqs.org/rfcs/rfc2965.html  (Cookie2)
   http://www.faqs.org/rfcs/rfc2616.html  (HTTP/1.1)

TO-DO: Implement the equivalent of various useful methods found in the
javax.servlet.http.HttpSession portion of the Java Servlet API.</description>
      <method-resolution-order>
        <base name="Session" module="Ft.Server.Server.Http.Session"/>
      </method-resolution-order>
      <methods documented="yes" class="Session" module="Ft.Server.Server.Http.Session" inherited="no">
        <method public="no" name="__init__" id="Session-__init__">
          <abstract>A session object is initially created without a session ID.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="yes" name="create" id="Session-create">
          <abstract>This method is called to allow a session to do whatever initialization
can be done once its ID is known. (The ID is not known when the class
is instantiated)</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="sid"/>
          </arguments>
        </method>
        <method public="yes" name="getSessionId" id="Session-getSessionId">
          <abstract>Get the session ID.  Must be overridden</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="args"/>
            <arg name="headers"/>
          </arguments>
        </method>
        <method public="yes" name="updateBody" id="Session-updateBody">
          <abstract>This method is called to allow a session to update the response body
before it is written out.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="repo"/>
            <arg name="body"/>
          </arguments>
        </method>
        <method public="yes" name="updateHeaders" id="Session-updateHeaders">
          <abstract>This method is called to allow a session to update the persistence
mechanism in the process of the HTTP response (cookie, URL re-write,
etc.)</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="repo"/>
            <arg name="headers"/>
            <arg name="logger"/>
          </arguments>
        </method>
      </methods>
    </class>
  </classes>
  <functions>
    <function public="yes" name="Create" id="Create">
      <abstract>Creates and returns a new session with the given ID</abstract>
      <description/>
      <arguments>
        <arg name="sid"/>
        <arg name="method"/>
        <arg default="None" name="logger"/>
      </arguments>
    </function>
    <function public="yes" name="Retrieve" id="Retrieve">
      <abstract>Examines the given request headers for a reference to an existing
session. (e.g., a Cookie header with a session-id value). If the 4SS
repository contains data for the referenced session, a Session object
with the appropriate ID and session data is returned. Otherwise, None
is returned.</abstract>
      <description/>
      <arguments>
        <arg name="args"/>
        <arg name="headers"/>
        <arg name="sessionType"/>
        <arg default="None" name="logger"/>
      </arguments>
    </function>
  </functions>
  <fields>
    <field public="yes" name="g_sessionFactory" id="g_sessionFactory">
      <value>{'Cookie': &lt;class Ft.Server.Server.Http.Session.CookieSession&gt;}</value>
    </field>
  </fields>
</module>
