2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision: 634760 $ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_session_cookie.xml.meta">
25 <name>mod_session_cookie</name>
26 <description>Cookie based session support</description>
27 <status>Extension</status>
28 <sourcefile>mod_session_cookie.c</sourcefile>
29 <identifier>session_cookie_module</identifier>
32 <note type="warning"><title>Warning</title>
33 <p>The session modules make use of HTTP cookies, and as such can fall
34 victim to Cross Site Scripting attacks, or expose potentially private
35 information to clients. Please ensure that the relevant risks have
36 been taken into account before enabling the session functionality on
40 <p>This submodule of <module>mod_session</module> provides support for the
41 storage of user sessions on the remote browser within HTTP cookies.</p>
43 <p>Using cookies to store a session removes the need for the server or
44 a group of servers to store the session locally, or collaborate to share
45 a session, and can be useful for high traffic environments where a
46 server based session might be too resource intensive.</p>
48 <p>If session privacy is required, the <module>mod_session_crypto</module>
49 module can be used to encrypt the contents of the session before writing
50 the session to the client.</p>
52 <p>For more details on the session interface, see the documentation for
53 the <module>mod_session</module> module.</p>
56 <seealso><module>mod_session</module></seealso>
57 <seealso><module>mod_session_crypto</module></seealso>
58 <seealso><module>mod_session_dbd</module></seealso>
60 <section id="basicexamples"><title>Basic Examples</title>
62 <p>To create a simple session and store it in a cookie called
63 <var>session</var>, configure the session as follows:</p>
65 <example><title>Browser based session</title>
67 SessionCookieName session path=/<br />
70 <p>For more examples on how the session can be configured to be read
71 from and written to by a CGI application, see the
72 <module>mod_session</module> examples section.</p>
74 <p>For documentation on how the session can be used to store username
75 and password details, see the <module>mod_auth_form</module> module.</p>
80 <name>SessionCookieName</name>
81 <description>Name and attributes for the RFC2109 cookie storing the session</description>
82 <syntax>SessionCookieName <var>name</var> <var>attributes</var></syntax>
83 <default>none</default>
84 <contextlist><context>directory</context>
86 <compatibility>Available in Apache 2.3.0 and later</compatibility>
89 <p>The <directive>SessionCookieName</directive> directive specifies the name and
90 optional attributes of an RFC2109 compliant cookie inside which the session will
91 be stored. RFC2109 cookies are set using the <code>Set-Cookie</code> HTTP header.
94 <p>An optional list of cookie attributes can be specified, as per the example below.
95 These attributes are inserted into the cookie as is, and are not interpreted by
96 Apache. Ensure that your attributes are defined correctly as per the cookie specification.
99 <example><title>Cookie with attributes</title>
101 SessionCookieName session path=/private;domain=example.com;httponly;secure;version=1;<br />
108 <name>SessionCookieName2</name>
109 <description>Name and attributes for the RFC2965 cookie storing the session</description>
110 <syntax>SessionCookieName2 <var>name</var> <var>attributes</var></syntax>
111 <default>none</default>
112 <contextlist><context>directory</context>
114 <compatibility>Available in Apache 2.3.0 and later</compatibility>
117 <p>The <directive>SessionCookieName2</directive> directive specifies the name and
118 optional attributes of an RFC2965 compliant cookie inside which the session will
119 be stored. RFC2965 cookies are set using the <code>Set-Cookie2</code> HTTP header.
122 <p>An optional list of cookie attributes can be specified, as per the example below.
123 These attributes are inserted into the cookie as is, and are not interpreted by
124 Apache. Ensure that your attributes are defined correctly as per the cookie specification.
127 <example><title>Cookie2 with attributes</title>
129 SessionCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;<br />
136 <name>SessionCookieRemove</name>
137 <description>Control for whether session cookies should be removed from incoming HTTP headers</description>
138 <syntax>SessionCookieRemove On|Off</syntax>
139 <default>SessionCookieRemove Off</default>
140 <contextlist><context>directory</context>
142 <compatibility>Available in Apache 2.3.0 and later</compatibility>
145 <p>The <directive>SessionCookieRemove</directive> flag controls whether the cookies
146 containing the session will be removed from the headers during request processing.</p>
148 <p>In a reverse proxy situation where the Apache server acts as a server frontend for
149 a backend origin server, revealing the contents of the session cookie to the backend
150 could be a potential privacy violation. When set to on, the session cookie will be
151 removed from the incoming HTTP headers.</p>