forked from ring-clojure/ring
/
middleware.session-api.html
179 lines (172 loc) · 9.04 KB
/
middleware.session-api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<html>
<head>
<title>middleware.session API reference (Ring)</title>
<link href="static/favicon.png" rel="icon" />
<link href="static/favicon.png" rel="shortcut icon" />
<link media="all" type="text/css" href="static/clojure.css" rel="stylesheet" />
<link media="all" type="text/css" href="static/wiki.css" rel="stylesheet" />
<link media="all" type="text/css" href="static/internal.css" rel="stylesheet" />
<!-- TODO: are we using these (from clojure.org)? If so, add the files -->
<script src="file/view/code_highlighter.js" type="text/javascript"></script>
<script src="file/view/clojure.js" type="text/javascript"></script>
<style>.menuWrapper{height: 36px;}</style>
<!--[if lte IE 6]>
<link rel="stylesheet" href="http://www.wikispaces.com/_/2009051601/s/internal_ie.css" type="text/css" />
<![endif]-->
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a id="Logo" href="index.html"><img alt="Clojure" height="100" width="100" src="static/clojure-icon.gif" /></a>
<h1><a title="page header title" id="page-header" href="index.html">Ring</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<a class="wiki_link" href="index.html">Overview</a><br />
<a class="wiki_link" href="api-index.html">API Index</a><br />
<a class="wiki_link" href="#">Namespaces:</a>
<ul id="left-sidebar-list">
<li><a href="adapter.httpcore-api.html" class="wiki_link">adapter.httpcore</a></li><li><a href="adapter.jetty-api.html" class="wiki_link">adapter.jetty</a></li><li><a href="handler.dump-api.html" class="wiki_link">handler.dump</a></li><li><a href="middleware.cookies-api.html" class="wiki_link">middleware.cookies</a></li><li><a href="middleware.file-api.html" class="wiki_link">middleware.file</a></li><li><a href="middleware.file-info-api.html" class="wiki_link">middleware.file-info</a></li><li><a href="middleware.flash-api.html" class="wiki_link">middleware.flash</a></li><li><a href="middleware.keyword-params-api.html" class="wiki_link">middleware.keyword-params</a></li><li><a href="middleware.lint-api.html" class="wiki_link">middleware.lint</a></li><li><a href="middleware.multipart-params-api.html" class="wiki_link">middleware.multipart-params</a></li><li><a href="middleware.nested-params-api.html" class="wiki_link">middleware.nested-params</a></li><li><a href="middleware.params-api.html" class="wiki_link">middleware.params</a></li><li><a href="middleware.reload-api.html" class="wiki_link">middleware.reload</a></li><li><a href="middleware.session-api.html" class="wiki_link">middleware.session</a></li><li><a href="middleware.stacktrace-api.html" class="wiki_link">middleware.stacktrace</a></li><li><a href="middleware.static-api.html" class="wiki_link">middleware.static</a></li><li><a href="util.codec-api.html" class="wiki_link">util.codec</a></li><li><a href="util.response-api.html" class="wiki_link">util.response</a></li><li><a href="util.servlet-api.html" class="wiki_link">util.servlet</a></li><li><a href="util.test-api.html" class="wiki_link">util.test</a></li>
</ul>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div id="content_view" class="wiki wikiPage">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div style="margin-left: 1em;" class="toc-section">
<a href="#toc0">Overview</a>
<div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session/wrap-session">wrap-session</a>
</div>
<br />
</div><div style="margin-left: 1em;" class="toc-section">
<a href="#middleware.session.cookie">middleware.session.cookie</a>
<div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session.cookie/cookie-store">cookie-store</a>
</div>
<br />
</div><div style="margin-left: 1em;" class="toc-section">
<a href="#middleware.session.memory">middleware.session.memory</a>
<div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session.memory/memory-store">memory-store</a>
</div>
<br />
</div><div style="margin-left: 1em;" class="toc-section">
<a href="#middleware.session.store">middleware.session.store</a>
<div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session.store/delete-session">delete-session</a>
</div><div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session.store/read-session">read-session</a>
</div><div style="margin-left: 1em;" class="toc-entry">
<a href="#ring.middleware.session.store/write-session">write-session</a>
</div>
<br />
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="namespace-name">middleware.session</span></h1>
<pre id="namespace-docstr">Session manipulation.</pre>
<div id="var-entry">
<br />
<hr />
<h2 id="ring.middleware.session/wrap-session">wrap-session</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (wrap-session handler)
(wrap-session handler options)
</pre>
<pre id="var-docstr">Reads in the current HTTP session map, and adds it to the :session key on
the request. If a :session key is added to the response by the handler, the
session is updated with the new value. If the value is nil, the session is
deleted.
The following options are available:
:store
An implementation map containing :read, :write, and :delete
keys. This determines how the session is stored. Defaults to
in-memory storage.
:root
The root path of the session. Anything path above this will not
be able to see this session. Equivalent to setting the cookie's
path attribute. Defaults to "/".
:cookie-name
The name of the cookie that holds the session key. Defaults to
"ring-session"
:cookie-attrs
A map of attributes to associate with the session cookie. Defaults
to {}.</pre>
<a href="http://github.com/mmcgrana/ring/blob//ring-servlet/checkouts/ring-core/src/ring/middleware/session.clj#L6" id="var-source">Source</a>
</div>
<h2 id="namespace-name">middleware.session.cookie</h2>
<pre id="namespace-docstr">Encrypted cookie session storage.</pre>
<div id="var-entry">
<hr />
<h2 id="ring.middleware.session.cookie/cookie-store">cookie-store</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (cookie-store)
(cookie-store options)
</pre>
<pre id="var-docstr">Creates an encrypted cookie storage engine.</pre>
<a href="http://github.com/mmcgrana/ring/blob//ring-servlet/checkouts/ring-core/src/ring/middleware/session/cookie.clj#L97" id="var-source">Source</a>
</div>
<h2 id="namespace-name">middleware.session.memory</h2>
<pre id="namespace-docstr">In-memory session storage.</pre>
<div id="var-entry">
<hr />
<h2 id="ring.middleware.session.memory/memory-store">memory-store</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (memory-store)
(memory-store session-atom)
</pre>
<pre id="var-docstr">Creates an in-memory session storage engine.</pre>
<a href="http://github.com/mmcgrana/ring/blob//ring-servlet/checkouts/ring-core/src/ring/middleware/session/memory.clj#L18" id="var-source">Source</a>
</div>
<h2 id="namespace-name">middleware.session.store</h2>
<pre id="namespace-docstr">Common session store objects and functions.</pre>
<div id="var-entry">
<hr />
<h2 id="ring.middleware.session.store/delete-session">delete-session</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (delete-session store key)
</pre>
<pre id="var-docstr">Delete a session map from the store.</pre>
</div><div id="var-entry">
<hr />
<h2 id="ring.middleware.session.store/read-session">read-session</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-session store key)
</pre>
<pre id="var-docstr">Read a session map from the store.</pre>
</div><div id="var-entry">
<hr />
<h2 id="ring.middleware.session.store/write-session">write-session</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (write-session store key data)
</pre>
<pre id="var-docstr">Write a session map to the store.</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div style="text-align: center;" id="copyright">Copyright 2009-2010 Mark McGranaghan</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a title="Visit Tom Hickey's website." href="http://www.tomhickey.com">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>