You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2007/06/07 18:53:24 UTC

[DAISY] Created: Session Object

A new document has been created.

http://cocoon.zones.apache.org/daisy/documentation/1385.html

Document ID: 1385
Branch: main
Language: default
Name: Session Object
Document Type: Cocoon Document
Created: 6/7/07 4:53:04 PM
Creator (owner): Reinhard Pötz
State: publish

Parts
=====

Content
-------
Mime type: text/xml
Size: 2732 bytes
Content:
<html>
<body>

<p>The <tt>Session</tt> object represents the user session associated with the
current Cocoon request.</p>

<p>It provides the following functions and properties:</p>

<h3>getAttribute</h3>

<p><em>Function</em> <tt>[Object] getAttribute([String] name)</tt></p>

<p>Get the value of the session attribute with the specified <tt>name</tt>.</p>

<h3>setAttribute</h3>

<p><em>Function</em> <tt>setAttribute([String] name, [Object] value)</tt></p>

<p>Set the value of the session attribute with the specified <tt>name</tt> to
<tt>value</tt>.</p>

<h3>removeAttribute</h3>

<p><em>Function</em> <tt>removeAttribute([String] name)</tt></p>

<p>Remove the session attribute with the specified <tt>name</tt>.</p>

<h3>invalidate</h3>

<p><em>Function</em> <tt>invalidate()</tt></p>

<p>Invalidate this session, releasing all resources associated with it.</p>

<h3>isNew</h3>

<p><em>Function</em> <tt>[Boolean] isNew()</tt></p>

<p>Returns <tt>true</tt> if the client does not yet know about the session or if
the client chooses not to join the session. For example, if the server used only
cookie-based sessions, and the client had disabled the use of cookies, then a
session would be new on each request.</p>

<h3>getId</h3>

<p><em>Function</em> <tt>[String] getId()</tt></p>

<p>Returns the unique id associated with this session.</p>

<h3>getCreationTime</h3>

<p><em>Function</em> <tt>[Number] getCreationTime()</tt></p>

<p>Returns the time when this session was created, measured in milliseconds
since midnight January 1, 1970 GMT.</p>

<h3>getLastAccessedTime</h3>

<p><em>Function</em> <tt>[Number] getLastAccessedTime()</tt></p>

<p>Returns the last time the client sent a request associated with this session,
as the number of milliseconds since midnight January 1, 1970 GMT.</p>

<h3>setMaxInactiveInterval</h3>

<p><em>Function</em> <tt>setMaxInactiveInterval([Number] interval)</tt></p>

<p>Specifies the time, in seconds, between client requests before the
contextcontainer will invalidate this session. A negative time indicates the
session should never timeout.</p>

<h3>getMaxInactiveInterval</h3>

<p><em>Function</em> <tt>[Number] getMaxInactiveInterval()</tt></p>

<p>Returns the maximum time interval, in seconds, that the context container
will keep this session open between client accesses. After this interval, the
context container will invalidate the session. The maximum time interval can be
set with the <tt>setMaxInactiveInterval</tt> method. A negative time indicates
the session should never timeout.</p>

<h3>Properties</h3>

<p><tt>Session</tt> properties map to session attributes, i.e.
<tt>session.blah</tt> is equivalent to <tt>session.getAttribute("blah")</tt>.
</p>

</body>
</html>

Collections
===========
The document belongs to the following collections: cdocs-flowscript