forked from noir-clojure/noir
/
noir.cookies.html
10 lines (10 loc) · 3.12 KB
/
noir.cookies.html
1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html>
<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>noir.cookies documentation</title></head><body><div id="header"><h1><a href="index.html">Noir 1.3.0-beta1 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3>Namespaces</h3><ul><li class="current"><a href="noir.cookies.html"><span>noir.cookies</span></a></li><li><a href="noir.core.html"><span>noir.core</span></a></li><li><a href="noir.options.html"><span>noir.options</span></a></li><li><a href="noir.request.html"><span>noir.request</span></a></li><li><a href="noir.response.html"><span>noir.response</span></a></li><li><a href="noir.server.html"><span>noir.server</span></a></li><li><a href="noir.server.handler.html"><span>noir.server.handler</span></a></li><li><a href="noir.session.html"><span>noir.session</span></a></li><li><a href="noir.statuses.html"><span>noir.statuses</span></a></li><li><a href="noir.util.crypt.html"><span>noir.util.crypt</span></a></li><li><a href="noir.util.gae.html"><span>noir.util.gae</span></a></li><li><a href="noir.util.test.html"><span>noir.util.test</span></a></li><li><a href="noir.validation.html"><span>noir.validation</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="noir.cookies.html#var-get"><span>get</span></a></li><li><a href="noir.cookies.html#var-get-signed"><span>get-signed</span></a></li><li><a href="noir.cookies.html#var-put%21"><span>put!</span></a></li><li><a href="noir.cookies.html#var-put-signed%21"><span>put-signed!</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>noir.cookies documentation</h2><pre class="doc">Stateful access to cookie values
</pre><div class="public" id="var-get"><h3>get</h3><div class="usage"><code>(get k)</code><code>(get k default)</code></div><pre class="doc">Get the value of a cookie from the request. k can either be a string or keyword.
If this is a signed cookie, use get-signed, otherwise the signature will not be
checked.</pre></div><div class="public" id="var-get-signed"><h3>get-signed</h3><div class="usage"><code>(get-signed sign-key k)</code><code>(get-signed sign-key k default)</code></div><pre class="doc">Get the value of a cookie from the request using 'get'. Verifies that a signing
cookie also exists. If not, returns default or nil. </pre></div><div class="public" id="var-put%21"><h3>put!</h3><div class="usage"><code>(put! k v)</code></div><pre class="doc">Add a new cookie whose name is k and has the value v. If v is a string
a cookie map is created with :path '/'. To set custom attributes, such as
"expires", provide a map as v. Stores all keys as strings.</pre></div><div class="public" id="var-put-signed%21"><h3>put-signed!</h3><div class="usage"><code>(put-signed! sign-key k v)</code></div><pre class="doc">Adds a new cookie whose name is k and has the value v. In addition,
adds another cookie that checks the authenticity of 'v'. Sign-key
should be a secret that's user-wide, session-wide or site wide (worst).</pre></div></div></body></html>