]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_session_cookie.html.en
Fixes the 'FAQ' link in the header and footer.
[apache] / docs / manual / mod / mod_session_cookie.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_session_cookie - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
13 </script>
14
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body>
17 <div id="page-header">
18 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
19 <p class="apache">Apache HTTP Server Version 2.5</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
22 <div id="path">
23 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_session_cookie</h1>
26 <div class="toplang">
27 <p><span>Available Languages: </span><a href="../en/mod/mod_session_cookie.html" title="English">&nbsp;en&nbsp;</a></p>
28 </div>
29 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Cookie based session support</td></tr>
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
31 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>session_cookie_module</td></tr>
32 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_session_cookie.c</td></tr>
33 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.3 and later</td></tr></table>
34 <h3>Summary</h3>
35
36     <div class="warning"><h3>Warning</h3>
37       <p>The session modules make use of HTTP cookies, and as such can fall
38       victim to Cross Site Scripting attacks, or expose potentially private
39       information to clients. Please ensure that the relevant risks have
40       been taken into account before enabling the session functionality on
41       your server.</p>
42     </div>
43
44     <p>This submodule of <code class="module"><a href="../mod/mod_session.html">mod_session</a></code> provides support for the
45     storage of user sessions on the remote browser within HTTP cookies.</p>
46
47     <p>Using cookies to store a session removes the need for the server or
48     a group of servers to store the session locally, or collaborate to share
49     a session, and can be useful for high traffic environments where a
50     server based session might be too resource intensive.</p>
51
52     <p>If session privacy is required, the <code class="module"><a href="../mod/mod_session_crypto.html">mod_session_crypto</a></code>
53     module can be used to encrypt the contents of the session before writing
54     the session to the client.</p>
55
56     <p>For more details on the session interface, see the documentation for
57     the <code class="module"><a href="../mod/mod_session.html">mod_session</a></code> module.</p>
58
59 </div>
60 <div id="quickview"><h3 class="directives">Directives</h3>
61 <ul id="toc">
62 <li><img alt="" src="../images/down.gif" /> <a href="#sessioncookiename">SessionCookieName</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#sessioncookiename2">SessionCookieName2</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#sessioncookieremove">SessionCookieRemove</a></li>
65 </ul>
66 <h3>Topics</h3>
67 <ul id="topics">
68 <li><img alt="" src="../images/down.gif" /> <a href="#basicexamples">Basic Examples</a></li>
69 </ul><h3>See also</h3>
70 <ul class="seealso">
71 <li><code class="module"><a href="../mod/mod_session.html">mod_session</a></code></li>
72 <li><code class="module"><a href="../mod/mod_session_crypto.html">mod_session_crypto</a></code></li>
73 <li><code class="module"><a href="../mod/mod_session_dbd.html">mod_session_dbd</a></code></li>
74 </ul></div>
75 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
76 <div class="section">
77 <h2><a name="basicexamples" id="basicexamples">Basic Examples</a></h2>
78
79       <p>To create a simple session and store it in a cookie called
80       <var>session</var>, configure the session as follows:</p>
81
82       <div class="example"><h3>Browser based session</h3><pre class="prettyprint lang-config">
83 Session On
84 SessionCookieName session path=/
85         </pre>
86 </div>
87
88       <p>For more examples on how the session can be configured to be read
89       from and written to by a CGI application, see the
90       <code class="module"><a href="../mod/mod_session.html">mod_session</a></code> examples section.</p>
91
92       <p>For documentation on how the session can be used to store username
93       and password details, see the <code class="module"><a href="../mod/mod_auth_form.html">mod_auth_form</a></code> module.</p>
94
95     </div>
96 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
97 <div class="directive-section"><h2><a name="SessionCookieName" id="SessionCookieName">SessionCookieName</a> <a name="sessioncookiename" id="sessioncookiename">Directive</a></h2>
98 <table class="directive">
99 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name and attributes for the RFC2109 cookie storing the session</td></tr>
100 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SessionCookieName <var>name</var> <var>attributes</var></code></td></tr>
101 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
102 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
103 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
104 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_session_cookie</td></tr>
105 </table>
106     <p>The <code class="directive">SessionCookieName</code> directive specifies the name and
107     optional attributes of an RFC2109 compliant cookie inside which the session will
108     be stored. RFC2109 cookies are set using the <code>Set-Cookie</code> HTTP header.
109     </p>
110
111     <p>An optional list of cookie attributes can be specified, as per the example below.
112     These attributes are inserted into the cookie as is, and are not interpreted by
113     Apache. Ensure that your attributes are defined correctly as per the cookie specification.
114     </p>
115
116     <div class="example"><h3>Cookie with attributes</h3><pre class="prettyprint lang-config">
117 Session On
118 SessionCookieName session path=/private;domain=example.com;httponly;secure;version=1;
119       </pre>
120 </div>
121
122
123 </div>
124 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
125 <div class="directive-section"><h2><a name="SessionCookieName2" id="SessionCookieName2">SessionCookieName2</a> <a name="sessioncookiename2" id="sessioncookiename2">Directive</a></h2>
126 <table class="directive">
127 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name and attributes for the RFC2965 cookie storing the session</td></tr>
128 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SessionCookieName2 <var>name</var> <var>attributes</var></code></td></tr>
129 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
130 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
131 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
132 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_session_cookie</td></tr>
133 </table>
134     <p>The <code class="directive">SessionCookieName2</code> directive specifies the name and
135     optional attributes of an RFC2965 compliant cookie inside which the session will
136     be stored. RFC2965 cookies are set using the <code>Set-Cookie2</code> HTTP header.
137     </p>
138
139     <p>An optional list of cookie attributes can be specified, as per the example below.
140     These attributes are inserted into the cookie as is, and are not interpreted by
141     Apache. Ensure that your attributes are defined correctly as per the cookie specification.
142     </p>
143
144     <div class="example"><h3>Cookie2 with attributes</h3><pre class="prettyprint lang-config">
145 Session On
146 SessionCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;
147     </pre>
148 </div>
149
150
151 </div>
152 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
153 <div class="directive-section"><h2><a name="SessionCookieRemove" id="SessionCookieRemove">SessionCookieRemove</a> <a name="sessioncookieremove" id="sessioncookieremove">Directive</a></h2>
154 <table class="directive">
155 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Control for whether session cookies should be removed from incoming HTTP headers</td></tr>
156 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SessionCookieRemove On|Off</code></td></tr>
157 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SessionCookieRemove Off</code></td></tr>
158 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
159 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
160 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_session_cookie</td></tr>
161 </table>
162     <p>The <code class="directive">SessionCookieRemove</code> flag controls whether the cookies
163     containing the session will be removed from the headers during request processing.</p>
164
165     <p>In a reverse proxy situation where the Apache server acts as a server frontend for
166     a backend origin server, revealing the contents of the session cookie to the backend
167     could be a potential privacy violation. When set to on, the session cookie will be
168     removed from the incoming HTTP headers.</p>
169
170
171 </div>
172 </div>
173 <div class="bottomlang">
174 <p><span>Available Languages: </span><a href="../en/mod/mod_session_cookie.html" title="English">&nbsp;en&nbsp;</a></p>
175 </div><div id="footer">
176 <p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
177 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
178 if (typeof(prettyPrint) !== undefined) {
179     prettyPrint();
180 }
181 //--><!]]></script>
182 </body></html>