blob: ee6d34efe9b2f2eb17884bfd6cee31ed550b46cb [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
<document>
<header>
<title>Session Management</title>
<authors>
<person name="Carsten Ziegeler" email="cziegeler@s-und-n.de"/>
</authors>
</header>
<body>
<s1 title="Introduction">
<p>This chapter describes the basic Cocoon session management using
the session transformer.</p>
<p>The chapter "Special Contexts" explains some special
contexts which do not require a session. They are available everytime. These
special contexts are the request context and the
temporary context.</p>
</s1>
<s1 title="Session Tracking">
<p>If a user has a session, Cocoon is able to connect new requests from this user
to the session of the user. This is done by session tracking. Basically,
the session tracking of Cocoon uses the session tracking of the environment,
which is usually the servlet engine.
</p>
<p>There are two methods for session tracking: cookies and url rewriting. If you
use cookies, you don't have to care about session tracking. Just refer to
the documentation of your servlet engine on how to turn on cookies for session
handling.</p>
<p>URL rewriting instead is a little bit complicated. For url rewriting, each link
the user can select, needs a special session ID appended to this link.
Unfortunately, this is not done automatically by Cocoon or the servlet engine.
You can either do this by hand or you can use the <em>encodeURL</em> transformer
just before the <em>html serializer</em>.
</p>
</s1>
<s1 title="Sessions">
<p>The session action is responsible for creating and
terminating a session. It is controlled by a sitemap parameter named "action".
This parameter can have the values "create" and "terminate". If no parameter is
set, it defaults to "create".</p>
<p>The action either creates a new session immediately (if not already
available), or terminates it (if available).</p>
</s1>
</body>
</document>