| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd"> |
| <document> |
| <header> |
| <title>Session Action</title> |
| <version>0.1</version> |
| <type>Technical document</type> |
| <authors> |
| <person name="Carsten Ziegeler" email="cziegeler@apache.org"/> |
| </authors> |
| <abstract>This document describes the session action.</abstract> |
| </header> |
| <body> |
| <s1 title="Session Action"> |
| <p> |
| The session action helps in managing the session of a user on |
| the server. It can create and terminate a session. The function |
| is controlled by a parameter named 'action'. |
| </p> |
| <p>For more information on session handling and session contexts |
| have a look at the <link href="../../developing/webapps/session.html">Session Context documentation</link>.</p> |
| <s2 title="Creating a Session"> |
| <p> |
| To create a session (if it not already exists) simply add the |
| action in your pipeline: |
| </p> |
| <source> |
| <![CDATA[ |
| <map:act type="session"/> |
| ]]> |
| </source> |
| <p>This is the equivalent to specify the 'action' parameter |
| with the value 'create':</p> |
| <source> |
| <![CDATA[ |
| <map:act type="session"> |
| <map:parameter name="action" value="create"/> |
| </map:act> |
| ]]> |
| </source> |
| </s2> |
| <s2 title="Terminating a Session"> |
| <p>Terminating a session is as easy as creating a session, simply |
| add the action to your pipeline and set the 'action' parameter |
| to 'terminate':</p> |
| <source> |
| <![CDATA[ |
| <map:act type="session"> |
| <map:parameter name="action" value="terminate"/> |
| </map:act> |
| ]]> |
| </source> |
| <p>This terminates the session immediately.</p> |
| <p>You can optionally specifiy the 'mode' parameter which controlls |
| the termination of the session. You have the choice between |
| 'immediately' (the default) and 'if-unsued'. If you use the |
| mode 'if-unused', the session is only terminated, if no session |
| context exists for the user:</p> |
| <source> |
| <![CDATA[ |
| <map:act type="session"> |
| <map:parameter name="action" value="terminate"/> |
| <map:parameter name="mode" value="if-unused"/> |
| </map:act> |
| ]]> |
| </source> |
| </s2> |
| </s1> |
| <s1 title="Configuration"> |
| <ul> |
| <li>Name : session</li> |
| <li>Class: org.apache.cocoon.webapps.session.acting.SessionAction</li> |
| </ul> |
| </s1> |
| </body> |
| </document> |