-
Notifications
You must be signed in to change notification settings - Fork 0
/
amelinium.http.middleware.session.html
103 lines (103 loc) · 94.3 KB
/
amelinium.http.middleware.session.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
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.http.middleware.session documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Amelinium</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch current"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-active"><div class="inner"><span>active</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-active-valid.3F"><div class="inner"><span>active-valid?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-allow-expired"><div class="inner"><span>allow-expired</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-allow-hard-expired"><div class="inner"><span>allow-hard-expired</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-allow-soft-expired"><div class="inner"><span>allow-soft-expired</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-any-id"><div class="inner"><span>any-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-calc-expired.3F"><div class="inner"><span>calc-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-calc-hard-expired.3F"><div class="inner"><span>calc-hard-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-calc-soft-expired.3F"><div class="inner"><span>calc-soft-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-check-encrypted"><div class="inner"><span>check-encrypted</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-config"><div class="inner"><span>config</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-config.3F"><div class="inner"><span>config?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-control"><div class="inner"><span>control</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-control.3F"><div class="inner"><span>control?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-correct-state.3F"><div class="inner"><span>correct-state?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-create"><div class="inner"><span>create</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-created"><div class="inner"><span>created</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-created-valid.3F"><div class="inner"><span>created-valid?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-db-id"><div class="inner"><span>db-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-db-sid"><div class="inner"><span>db-sid</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-db-sid-smap"><div class="inner"><span>db-sid-smap</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-db-sid-str"><div class="inner"><span>db-sid-str</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-db-token"><div class="inner"><span>db-token</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-del-all-vars.21"><div class="inner"><span>del-all-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-del-session-vars.21"><div class="inner"><span>del-session-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-del-user-vars.21"><div class="inner"><span>del-user-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-del-var.21"><div class="inner"><span>del-var!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-del-vars.21"><div class="inner"><span>del-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete.21"><div class="inner"><span>delete!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete-all.21"><div class="inner"><span>delete-all!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete-session-by-id"><div class="inner"><span>delete-session-by-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete-session-vars"><div class="inner"><span>delete-session-vars</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete-sessions-by-uid"><div class="inner"><span>delete-sessions-by-uid</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-delete-user-vars"><div class="inner"><span>delete-user-vars</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-empty"><div class="inner"><span>empty</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-empty.3F"><div class="inner"><span>empty?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-encrypt"><div class="inner"><span>encrypt</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-err-id"><div class="inner"><span>err-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-error"><div class="inner"><span>error</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-error.3F"><div class="inner"><span>error?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-expired.3F"><div class="inner"><span>expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-fetch-var.21"><div class="inner"><span>fetch-var!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-fetch-vars.21"><div class="inner"><span>fetch-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-last-active"><div class="inner"><span>get-last-active</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-session-by-id"><div class="inner"><span>get-session-by-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-session-by-key"><div class="inner"><span>get-session-by-key</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-session-key"><div class="inner"><span>get-session-key</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-var"><div class="inner"><span>get-var</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-variable-failed.3F"><div class="inner"><span>get-variable-failed?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-get-vars"><div class="inner"><span>get-vars</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-hard-expired.3F"><div class="inner"><span>hard-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-id"><div class="inner"><span>id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-id-field"><div class="inner"><span>id-field</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-identify-session-path-compile"><div class="inner"><span>identify-session-path-compile</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-inject"><div class="inner"><span>inject</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-insecure.3F"><div class="inner"><span>insecure?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-invalid.3F"><div class="inner"><span>invalid?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-invalidate-cache.21"><div class="inner"><span>invalidate-cache!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-invalidate-multi"><div class="inner"><span>invalidate-multi</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-ip"><div class="inner"><span>ip</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-ip-state"><div class="inner"><span>ip-state</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-make"><div class="inner"><span>make</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-cache-almost-expired.3F"><div class="inner"><span>mem-cache-almost-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-cache-expired.3F"><div class="inner"><span>mem-cache-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-cache-time-left"><div class="inner"><span>mem-cache-time-left</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-cache-time-passed"><div class="inner"><span>mem-cache-time-passed</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-ctime"><div class="inner"><span>mem-ctime</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mem-etime"><div class="inner"><span>mem-etime</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mkbad"><div class="inner"><span>mkbad</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-mkgood"><div class="inner"><span>mkgood</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-not-empty-of"><div class="inner"><span>not-empty-of</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-not-empty.3F"><div class="inner"><span>not-empty?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-of"><div class="inner"><span>of</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-one-second"><div class="inner"><span>one-second</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-process"><div class="inner"><span>process</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-process-handler"><div class="inner"><span>process-handler</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-prolong"><div class="inner"><span>prolong</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-prolonged.3F"><div class="inner"><span>prolonged?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-put-var.21"><div class="inner"><span>put-var!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-put-vars.21"><div class="inner"><span>put-vars!</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-refresh-times"><div class="inner"><span>refresh-times</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-salt-splitter"><div class="inner"><span>salt-splitter</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-scrypt-options"><div class="inner"><span>scrypt-options</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-secure.3F"><div class="inner"><span>secure?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-security-failed.3F"><div class="inner"><span>security-failed?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-security-passed.3F"><div class="inner"><span>security-passed?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-session-key"><div class="inner"><span>session-key</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-session.3F"><div class="inner"><span>session?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-set-session"><div class="inner"><span>set-session</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-sid-match"><div class="inner"><span>sid-match</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-sid-valid"><div class="inner"><span>sid-valid</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-sid-valid.3F"><div class="inner"><span>sid-valid?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-soft-expired.3F"><div class="inner"><span>soft-expired?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-state"><div class="inner"><span>state</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-token-splitter"><div class="inner"><span>token-splitter</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-update-last-active"><div class="inner"><span>update-last-active</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-user-email"><div class="inner"><span>user-email</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-user-id"><div class="inner"><span>user-id</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-valid-of"><div class="inner"><span>valid-of</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-valid.3F"><div class="inner"><span>valid?</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-when-sid-valid"><div class="inner"><span>when-sid-valid</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.session.html#var-wrap-session"><div class="inner"><span>wrap-session</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.http.middleware.session</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>amelinium service, session middleware.</p>
</div></div><div class="public anchor" id="var-active"><h3>active</h3><div class="usage"><code>(active src)</code><code>(active src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:active</code> (last active time) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L542">view source</a></div></div><div class="public anchor" id="var-active-valid.3F"><h3>active-valid?</h3><div class="usage"><code>(active-valid? src)</code><code>(active-valid? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session has valid last-active time. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1059">view source</a></div></div><div class="public anchor" id="var-allow-expired"><h3>allow-expired</h3><div class="usage"><code>(allow-expired src)</code><code>(allow-expired src session-key)</code></div><div class="doc"><div class="markdown"><p>Temporarily marks expired session as valid. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1175">view source</a></div></div><div class="public anchor" id="var-allow-hard-expired"><h3>allow-hard-expired</h3><div class="usage"><code>(allow-hard-expired src)</code><code>(allow-hard-expired src session-key)</code></div><div class="doc"><div class="markdown"><p>Temporarily mark hard-expired session as valid.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1209">view source</a></div></div><div class="public anchor" id="var-allow-soft-expired"><h3>allow-soft-expired</h3><div class="usage"><code>(allow-soft-expired src)</code><code>(allow-soft-expired src session-key)</code></div><div class="doc"><div class="markdown"><p>Temporarily mark soft-expired session as valid. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1197">view source</a></div></div><div class="public anchor" id="var-any-id"><h3>any-id</h3><div class="usage"><code>(any-id src)</code><code>(any-id src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session ID from the given source and optional session key. May return a value of the <code>:id</code> or <code>:err-id</code> field. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L491">view source</a></div></div><div class="public anchor" id="var-calc-expired.3F"><h3>calc-expired?</h3><div class="usage"><code>(calc-expired? src session-key)</code><code>(calc-expired? src)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is expired by performing calculations on its last-active time and a configured timeout. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L973">view source</a></div></div><div class="public anchor" id="var-calc-hard-expired.3F"><h3>calc-hard-expired?</h3><div class="usage"><code>(calc-hard-expired? src session-key)</code><code>(calc-hard-expired? src)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is hard-expired by performing calculations on its last-active time and a configured timeout. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L984">view source</a></div></div><div class="public anchor" id="var-calc-soft-expired.3F"><h3>calc-soft-expired?</h3><div class="usage"><code>(calc-soft-expired? src session-key)</code><code>(calc-soft-expired? src)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is soft-expired by performing calculations on its last-active time and a configured timeout. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L995">view source</a></div></div><div class="public anchor" id="var-check-encrypted"><h3>check-encrypted</h3><div class="usage"><code>(check-encrypted plain-token encrypted-token-b64-str)</code></div><div class="doc"><div class="markdown"><p>Checks if the encrypted token given as <code>encrypted-token-b64-str</code> matches the given <code>plain-token</code>. Verifies its correctness by re-encrypting it with the same salt parameter as it was used when original token was created.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L720">view source</a></div></div><div class="public anchor" id="var-config"><h3>config</h3><div class="usage"><code>(config src)</code><code>(config src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a <code>SessionConfig</code> object from the given source and optional session key. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L461">view source</a></div></div><div class="public anchor" id="var-config.3F"><h3>config?</h3><div class="usage"><code>(config? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value <code>v</code> is an instance of <code>SessionConfig</code> record.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L50">view source</a></div></div><div class="public anchor" id="var-control"><h3>control</h3><div class="usage"><code>(control src)</code><code>(control src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a <code>SessionControl</code> object from the given source and optional session key. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L453">view source</a></div></div><div class="public anchor" id="var-control.3F"><h3>control?</h3><div class="usage"><code>(control? v)</code><code>(control? v k)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is an instance of a class which fully satisfies <code>SessionControl</code> protocol (directly or indirectly). If the indirect testing is required, the tested object must be convertable to a control object (as described by the <code>SessionControl</code> protocol).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L445">view source</a></div></div><div class="public anchor" id="var-correct-state.3F"><h3>correct-state?</h3><div class="usage"><code>(correct-state? state-result)</code><code>(correct-state? src ip-address)</code><code>(correct-state? src session-key ip-address)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if a session exists and its state is correct. Never throws an exception.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1113">view source</a></div></div><div class="public anchor" id="var-create"><h3>create</h3><div class="usage"><code>(create src user-id user-email ip-address)</code></div><div class="doc"><div class="markdown"><p>Creates a new session and puts it into a database. Returns a session record.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1786">view source</a></div></div><div class="public anchor" id="var-created"><h3>created</h3><div class="usage"><code>(created src)</code><code>(created src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:created</code> (creation time) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L532">view source</a></div></div><div class="public anchor" id="var-created-valid.3F"><h3>created-valid?</h3><div class="usage"><code>(created-valid? src)</code><code>(created-valid? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session has valid creation time. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1048">view source</a></div></div><div class="public anchor" id="var-db-id"><h3>db-id</h3><div class="usage"><code>(db-id src)</code><code>(db-id src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a database session ID from a session object or any other value which can be transformed into a session.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L738">view source</a></div></div><div class="public anchor" id="var-db-sid"><h3>db-sid</h3><div class="usage"><code>(db-sid obj)</code></div><div class="doc"><div class="markdown"><p>Extracts a database session ID from a secure session object, a map, or session ID. Works with session objects, maps, strings and identifiers (symbols and keywords).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L762">view source</a></div></div><div class="public anchor" id="var-db-sid-smap"><h3>db-sid-smap</h3><div class="usage"><code>(db-sid-smap smap)</code></div><div class="doc"><div class="markdown"><p>Extracts a database session ID from a secure session object. Tries <code>:db-id</code> field and if that fails uses <code>:id</code> or <code>:err-id</code> field of a session object and parses its string representation to obtain only its first part (if it consists of multiple parts separated with a dash character).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L748">view source</a></div></div><div class="public anchor" id="var-db-sid-str"><h3>db-sid-str</h3><div class="usage"><code>(db-sid-str sid)</code></div><div class="doc"><div class="markdown"><p>Extracts a database session ID from a secure session ID.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L757">view source</a></div></div><div class="public anchor" id="var-db-token"><h3>db-token</h3><div class="usage"><code>(db-token src)</code><code>(db-token src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:db-token</code> (security token in a database-suitable form) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L502">view source</a></div></div><div class="public anchor" id="var-del-all-vars.21"><h3>del-all-vars!</h3><div class="usage"><code>(del-all-vars! src session-key)</code><code>(del-all-vars! src)</code></div><div class="doc"><div class="markdown"><p>Deletes all session variables which belong to a user (is <code>single-session?</code> configuration option is <code>true</code>) or just variables for this session (if <code>single-session?</code> configuration option is <code>false</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1411">view source</a></div></div><div class="public anchor" id="var-del-session-vars.21"><h3>del-session-vars!</h3><div class="usage"><code>(del-session-vars! src session-key)</code><code>(del-session-vars! src)</code></div><div class="doc"><div class="markdown"><p>Deletes all session variables.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1439">view source</a></div></div><div class="public anchor" id="var-del-user-vars.21"><h3>del-user-vars!</h3><div class="usage"><code>(del-user-vars! src session-key)</code><code>(del-user-vars! src)</code></div><div class="doc"><div class="markdown"><p>Deletes all session variables which belong to a user across all sessions.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1429">view source</a></div></div><div class="public anchor" id="var-del-var.21"><h3>del-var!</h3><div class="usage"><code>(del-var! src var-name)</code><code>(del-var! src session-key var-name)</code></div><div class="doc"><div class="markdown"><p>Deletes a session variable <code>var-name</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1385">view source</a></div></div><div class="public anchor" id="var-del-vars.21"><h3>del-vars!</h3><div class="usage"><code>(del-vars! src var-names)</code><code>(del-vars! src session-key var-names)</code></div><div class="doc"><div class="markdown"><p>Deletes a session variables from <code>var-names</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1398">view source</a></div></div><div class="public anchor" id="var-delete.21"><h3>delete!</h3><div class="usage"><code>(delete! src)</code><code>(delete! src session-key)</code></div><div class="doc"><div class="markdown"><p>Deletes a session from a database. The session is identified by a session object or any other value which can be transformed into a session (<code>src</code>) with optional key (<code>session-key</code>) if this object is associative. Session variables are also removed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L812">view source</a></div></div><div class="public anchor" id="var-delete-all.21"><h3>delete-all!</h3><div class="usage"><code>(delete-all! src)</code><code>(delete-all! src session-key)</code><code>(delete-all! src user-id)</code><code>(delete-all! src session-key user-id)</code><code>(delete-all! ctrl user-id user-email ip-address)</code></div><div class="doc"><div class="markdown"><p>Deletes all user sessions from a database. The sessions are identified by a user ID derived from a session object, any other value which can be transformed into a session object (<code>src</code>) with optional session key for associative structures, or a user ID given directly (<code>user-id</code>). In the last case session will only be used to obtain control object so it may be a default session without any valid identifiers in it. Session variables are also removed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L828">view source</a></div></div><div class="public anchor" id="var-delete-session-by-id"><h3>delete-session-by-id</h3><div class="usage"><code>(delete-session-by-id opts db table db-sid)</code></div><div class="doc"><div class="markdown"><p>Deletes session identified with <code>db-sid</code> from a database <code>db</code>. Returns a sequence a map indicating deleted session properties, having keys <code>:id</code>, <code>:user-id</code>, <code>:user-email</code> and <code>:ip</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1291">view source</a></div></div><div class="public anchor" id="var-delete-session-vars"><h3>delete-session-vars</h3><div class="usage"><code>(delete-session-vars opts db sessions-table variables-table db-sid)</code></div><div class="doc"><div class="markdown"><p>Deletes session variables of a session identified with <code>db-sid</code> from a database <code>db</code>. Returns the number of affected rows in case of success.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1280">view source</a></div></div><div class="public anchor" id="var-delete-sessions-by-uid"><h3>delete-sessions-by-uid</h3><div class="usage"><code>(delete-sessions-by-uid opts db table user-id)</code></div><div class="doc"><div class="markdown"><p>Deletes sessions belonging to a used <code>user-id</code> from a database <code>db</code>. Returns a sequence of maps indicating deleted session rows, having keys <code>:id</code>, <code>:user-id</code>, <code>:user-email</code> and <code>:ip</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1301">view source</a></div></div><div class="public anchor" id="var-delete-user-vars"><h3>delete-user-vars</h3><div class="usage"><code>(delete-user-vars opts db sessions-table variables-table user-id)</code></div><div class="doc"><div class="markdown"><p>Deletes session variables which belong to a user <code>user-id</code> from a database <code>db</code>. Returns the number of affected rows in case of success.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1269">view source</a></div></div><div class="public anchor" id="var-empty"><h3>empty</h3><div class="usage"><code>(empty src)</code><code>(empty src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns an empty session record. Optional <code>session-key</code> may be given to express a key in associative structure (defaults to <code>:session</code>) used to perform a session lookup used to access the control object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L407">view source</a></div></div><div class="public anchor" id="var-empty.3F"><h3>empty?</h3><div class="usage"><code>(empty? src)</code><code>(empty? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>false</code> is <code>src</code> contains a session or is a session, and the session has usable identifier set (<code>:id</code> or <code>:err-id</code> field is set) or has the <code>:error</code> field set. Optional <code>session-key</code> may be given to express a key in associative structure (defaults to <code>:session</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L391">view source</a></div></div><div class="public anchor" id="var-encrypt"><h3>encrypt</h3><div class="usage"><code>(encrypt plain-token)</code></div><div class="doc"><div class="markdown"><p>Encrypts the given <code>plain-token</code> with Scrypt algorithm using randomly generated salt. Returns a Base64-encoded string with salt and encrypted password separated with a dollar character. The encrypted password is a result of applying one-way hashing function to the <code>plain-token</code> and salt.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L709">view source</a></div></div><div class="public anchor" id="var-err-id"><h3>err-id</h3><div class="usage"><code>(err-id src)</code><code>(err-id src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns an error session ID from the given source and optional session key. Works only on invalid sessions having <code>:err-id</code> field set. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L480">view source</a></div></div><div class="public anchor" id="var-error"><h3>error</h3><div class="usage"><code>(error src)</code><code>(error src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:error</code> (session error) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1163">view source</a></div></div><div class="public anchor" id="var-error.3F"><h3>error?</h3><div class="usage"><code>(error? src)</code><code>(error? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the <code>:error</code> (session error) property of a session is not <code>nil</code>. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1151">view source</a></div></div><div class="public anchor" id="var-expired.3F"><h3>expired?</h3><div class="usage"><code>(expired? src)</code><code>(expired? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is marked as expired. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1007">view source</a></div></div><div class="public anchor" id="var-fetch-var.21"><h3>fetch-var!</h3><div class="usage"><code>(fetch-var! src var-name)</code><code>(fetch-var! src session-key var-name)</code></div><div class="doc"><div class="markdown"><p>Like <code>get-var</code> but removes session variable after it is successfully read from a database. Variable is not removed if there was a problem with reading or de-serializing it.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1475">view source</a></div></div><div class="public anchor" id="var-fetch-vars.21"><h3>fetch-vars!</h3><div class="usage"><code>(fetch-vars! src var-names)</code><code>(fetch-vars! src session-key var-names)</code></div><div class="doc"><div class="markdown"><p>Like <code>get-vars</code> but removes session variable after it is successfully read from a database. Variables are not removed if there was a problem with reading or de-serializing them.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1493">view source</a></div></div><div class="public anchor" id="var-get-last-active"><h3>get-last-active</h3><div class="usage"><code>(get-last-active opts db table sid-db remote-ip)</code></div><div class="doc"><div class="markdown"><p>Returns last active time of a session identified with <code>sid-db</code> and selected from a database <code>db</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1240">view source</a></div></div><div class="public anchor" id="var-get-session-by-id"><h3>get-session-by-id</h3><div class="usage"><code>(get-session-by-id opts db table sid-db remote-ip)</code></div><div class="doc"><div class="markdown"><p>Standard session getter. Uses <code>db</code> to connect to a database and gets data identified by <code>sid</code> from a table <code>table</code>. Returns a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1234">view source</a></div></div><div class="public anchor" id="var-get-session-by-key"><h3>get-session-by-key</h3><div class="usage"><code>(get-session-by-key req)</code><code>(get-session-by-key req session-key)</code></div><div class="doc"><div class="markdown"><p>Obtains a session object from associative structure (usually a request map <code>req</code>) by looking for a value associated with a session key returned by calling <code>get-session-key</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L72">view source</a></div></div><div class="public anchor" id="var-get-session-key"><h3>get-session-key</h3><div class="usage"><code>(get-session-key req)</code><code>(get-session-key req session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session key as keyword by reading the given <code>session-key</code>, and if it is <code>nil</code> or <code>false</code> by getting a value associated with the <code>:session-key</code> route data key of the <code>req</code>, and if that fails by returning the <code>:session</code> keyword.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L60">view source</a></div></div><div class="public anchor" id="var-get-var"><h3>get-var</h3><div class="usage"><code>(get-var src var-name)</code><code>(get-var src session-key var-name)</code></div><div class="doc"><div class="markdown"><p>Gets a session variable and de-serializes it into a Clojure data structure.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1449">view source</a></div></div><div class="public anchor" id="var-get-variable-failed.3F"><h3>get-variable-failed?</h3><div class="usage"><code>(get-variable-failed? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the value <code>v</code> obtained from a session variable indicates that it actually could not be successfully fetched from a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1539">view source</a></div></div><div class="public anchor" id="var-get-vars"><h3>get-vars</h3><div class="usage"><code>(get-vars src var-names)</code><code>(get-vars src session-key var-names)</code></div><div class="doc"><div class="markdown"><p>Gets session variables and de-serializes them into a Clojure data structures.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1462">view source</a></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler src sid db-sid remote-ip)</code><code>(handler src session-key sid db-sid remote-ip)</code><code>(handler ctrl session-key id-field sid db-sid remote-ip)</code></div><div class="doc"><div class="markdown"><p>Gets session data from a database and processes them with session control functions and configuration options to generate a session record. When the record is created it is validated for errors and expiration times.</p>
<p>The results of calling this function may be memoized to reduce database hits. Note that if the cache TTL is larger than the remaining expiration time for a session, it may be required to refresh the times and re-validate the session object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1622">view source</a></div></div><div class="public anchor" id="var-hard-expired.3F"><h3>hard-expired?</h3><div class="usage"><code>(hard-expired? src)</code><code>(hard-expired? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is marked as hard-expired. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1020">view source</a></div></div><div class="public anchor" id="var-id"><h3>id</h3><div class="usage"><code>(id src)</code><code>(id src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session ID from the given source and optional session key. Works only on valid sessions having <code>:id</code> field set. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L469">view source</a></div></div><div class="public anchor" id="var-id-field"><h3>id-field</h3><div class="usage"><code>(id-field src)</code><code>(id-field src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:id-field</code> (field ID) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L572">view source</a></div></div><div class="public anchor" id="var-identify-session-path-compile"><h3>identify-session-path-compile</h3><div class="usage"><code>(identify-session-path-compile path)</code></div><div class="doc"><div class="markdown"><p>Returns a function which takes a request map and returns a session ID.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1220">view source</a></div></div><div class="public anchor" id="var-inject"><h3>inject</h3><div class="usage"><code>(inject dst smap)</code><code>(inject dst smap session-key)</code></div><div class="doc"><div class="markdown"><p>Returns an object updated with session record of type <code>Session</code> under an optional <code>session-key</code> if session is to be put into an associative structure (defaults to <code>:session</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L414">view source</a></div></div><div class="public anchor" id="var-insecure.3F"><h3>insecure?</h3><div class="usage"><code>(insecure? src)</code><code>(insecure? src session-key)</code></div><div class="doc"><div class="markdown"><p>Checks if session is not secure where it should be. If <code>:secured?</code> option is not enabled in configuration, it returns <code>false</code>. If <code>:secure?</code> flag is set to a falsy value, it returns <code>false</code>. If there is no session, it returns <code>true</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L887">view source</a></div></div><div class="public anchor" id="var-invalid.3F"><h3>invalid?</h3><div class="usage"><code>(invalid? src)</code><code>(invalid? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns negated value of the <code>:valid?</code> (validity) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map. If there is no session, returns <code>true</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1137">view source</a></div></div><div class="public anchor" id="var-invalidate-cache.21"><h3>invalidate-cache!</h3><div class="usage"><code>(invalidate-cache! src)</code><code>(invalidate-cache! src session-key)</code><code>(invalidate-cache! src session-key remote-ip)</code><code>(invalidate-cache! ctrl sid remote-ip)</code></div><div class="doc"><div class="markdown"><p>Invalidates cache for the specific session. The <code>src</code> can be a session object, a request (context) map with optional <code>session-key</code> as a second argument, or a <code>SessionControl</code> object with a session ID (<code>sid</code>). Remote IP address (used to match cache entries along with session database ID) will be obtained from the session object if not given or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1547">view source</a></div></div><div class="public anchor" id="var-invalidate-multi"><h3>invalidate-multi</h3><div class="usage"><code>(invalidate-multi ctrl sessions)</code></div><div class="doc"><div class="markdown"><p>Invalidates cache for multiple sessions by extracting their database IDs from maps. The <code>sessions</code> argument should be a sequence of maps or a sequence of <code>Session</code> objects. If they are maps they should have <code>:id</code> keys with associated database IDs. First argument should be a <code>SessionControl</code> object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L798">view source</a></div></div><div class="public anchor" id="var-ip"><h3>ip</h3><div class="usage"><code>(ip src)</code><code>(ip src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:ip</code> (IP address) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L552">view source</a></div></div><div class="public anchor" id="var-ip-state"><h3>ip-state</h3><div class="usage"><code>(ip-state smap user-id user-email remote-ip)</code></div><div class="doc"><div class="markdown"><p>Returns session IP state for the given session. If IP address is correct, returns <code>nil</code>, otherwise a <code>SessionError</code> record.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L933">view source</a></div></div><div class="public anchor" id="var-make"><h3>make</h3><div class="usage"><code>(make secured? ctrl skey id-field user-id user-email ip)</code></div><div class="doc"><div class="markdown"><p>Generates a session ID and adds it to newly created session object. The <code>secured?</code> flag can be set to generate secure session ID.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L776">view source</a></div></div><div class="public anchor" id="var-mem-cache-almost-expired.3F"><h3>mem-cache-almost-expired?</h3><div class="usage"><code>(mem-cache-almost-expired? ctrl key)</code><code>(mem-cache-almost-expired? ctrl key knee)</code><code>(mem-cache-almost-expired? ctrl key knee t)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if an entry associated with the given key <code>key</code> in a TTL map of a current handler cache has almost expired. The <code>knee</code> argument should be a number of milliseconds (defaults to 1000 if not given) to be added to a current time in order to shift it forward. If the entry does not exist, <code>true</code> is returned. Negative <code>knee</code> values will cause it to have 0 impact. Optional argument <code>t</code> may be given with a time expressed as an instant (<code>java.time.Instant</code>) to be used as a source of current time.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L625">view source</a></div></div><div class="public anchor" id="var-mem-cache-expired.3F"><h3>mem-cache-expired?</h3><div class="usage"><code>(mem-cache-expired? ctrl key t)</code><code>(mem-cache-expired? ctrl key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if an entry associated with the given key <code>key</code> in a TTL map of a current handler cache has expired. If the entry does not exist, <code>true</code> is returned. Optional argument <code>t</code> may be given with a time expressed as an instant (<code>java.time.Instant</code>) to be used as a source of current time.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L611">view source</a></div></div><div class="public anchor" id="var-mem-cache-time-left"><h3>mem-cache-time-left</h3><div class="usage"><code>(mem-cache-time-left ctrl key)</code><code>(mem-cache-time-left ctrl key t)</code></div><div class="doc"><div class="markdown"><p>Returns a time left to a cache expiry for an entry associated with the given key <code>key</code> in a TTL map of a current handler cache. The returned object is of type <code>java.time.Duration</code>. If the entry does not exist, <code>nil</code> is returned. Optional <code>t</code> argument may be given to express current time as <code>java.time.Instant</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L646">view source</a></div></div><div class="public anchor" id="var-mem-cache-time-passed"><h3>mem-cache-time-passed</h3><div class="usage"><code>(mem-cache-time-passed ctrl key)</code><code>(mem-cache-time-passed ctrl key t)</code></div><div class="doc"><div class="markdown"><p>Returns a time which passed till now from the creation of an entry associated with the given key <code>key</code> in a TTL map of a current handler cache. The returned object is of type <code>java.time.Duration</code> and its value may exceed the configured TTL when there was no cache update nor eviction for the entry. Optional <code>t</code> argument may be given to express current time as <code>java.time.Instant</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L660">view source</a></div></div><div class="public anchor" id="var-mem-ctime"><h3>mem-ctime</h3><div class="usage"><code>(mem-ctime ctrl key)</code></div><div class="doc"><div class="markdown"><p>Retrieves an entry creation time (in milliseconds) associated with the given <code>key</code> in a TTL map of a current handler cache. If the entry does not exist, <code>nil</code> is returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L592">view source</a></div></div><div class="public anchor" id="var-mem-etime"><h3>mem-etime</h3><div class="usage"><code>(mem-etime ctrl key)</code></div><div class="doc"><div class="markdown"><p>Retrieves an expiration time (in milliseconds since the beginning of the Unix epoch) of an entry identified by the given key <code>key</code> in a TTL map of a current handler cache. It is calculated by adding cache’s TTL to entry’s creation time. If the entry does not exist, <code>nil</code> is returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L600">view source</a></div></div><div class="public anchor" id="var-mkbad"><h3>mkbad</h3><div class="usage"><code>(mkbad smap k v a b c d & pairs)</code><code>(mkbad smap k v a b c d)</code><code>(mkbad smap k v a b)</code><code>(mkbad smap k v)</code><code>(mkbad smap)</code></div><div class="doc"><div class="markdown"><p>Marks session as invalid and sets <code>:err-id</code> field’s value to the value of <code>:id</code> field, then sets <code>:id</code> to <code>nil</code>. The given object should be a session.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1337">view source</a></div></div><div class="public anchor" id="var-mkgood"><h3>mkgood</h3><div class="usage"><code>(mkgood src session-key)</code><code>(mkgood src)</code></div><div class="doc"><div class="markdown"><p>Marks the given session <code>smap</code> as valid by setting <code>:valid?</code> field to <code>true</code>, <code>:expired?</code> and <code>:hard-expired?</code> fields to <code>false</code>, and <code>:error</code> field to <code>nil</code>. The given object should be a session.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1316">view source</a></div></div><div class="public anchor" id="var-not-empty-of"><h3>not-empty-of</h3><div class="usage"><code>(not-empty-of src)</code><code>(not-empty-of src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session if <code>src</code> contains a session or is a session, and the session has usable identifier set (<code>:id</code> or <code>:err-id</code> field is set) or has the <code>:error</code> field set. Optional <code>session-key</code> may be given to express a key in associative structure (defaults to <code>:session</code>). Returns <code>nil</code> if session is not usable (does not have <code>:id</code>, <code>:err-id</code> not <code>:error</code> set).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L421">view source</a></div></div><div class="public anchor" id="var-not-empty.3F"><h3>not-empty?</h3><div class="usage"><code>(not-empty? src)</code><code>(not-empty? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> is <code>src</code> contains a session or is a session, and the session has usable identifier set (<code>:id</code> or <code>:err-id</code> field is set) or has the <code>:error</code> field set. Optional <code>session-key</code> may be given to express a key in associative structure (defaults to <code>:session</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L399">view source</a></div></div><div class="public anchor" id="var-of"><h3>of</h3><div class="usage"><code>(of src)</code><code>(of src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session record of type <code>Session</code> on a basis of configuration source provided and an optional <code>session-key</code> if session must be looked in an associative structure (defaults to <code>:session</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L384">view source</a></div></div><div class="public anchor" id="var-one-second"><h3>one-second</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L48">view source</a></div></div><div class="public anchor" id="var-process"><h3>process</h3><div class="usage"><code>(process ctrl malformed-session empty-session cache-margin expires-in req)</code></div><div class="doc"><div class="markdown"><p>Takes a session control object, predefined session objects (for malformed and empty session), expiration settings and a request map, and validates a session against the database or memoized session data. Returns a session map or dummy session map if session was not obtained (session ID was not found in a database).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1729">view source</a></div></div><div class="public anchor" id="var-process-handler"><h3>process-handler</h3><div class="usage"><code>(process-handler ctrl cache-margin expires-in sid remote-ip)</code></div><div class="doc"><div class="markdown"><p>Session processing handler wrapper. For the given session ID <code>sid</code> and remote IP address <code>remote-ip</code> it runs <code>handle</code> (from <code>SessionControl</code> protocol) using <code>ctrl</code>. Then it quickly checks if the refresh is needed (by checking whether session is expired or by calling <code>needs-refresh?</code>). If re-reading expiration time from a database is required, it will do it and check if the time really has changed. In such case the session data in will be updated (by refreshing just the last active time or by handling it again after cache eviction).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1675">view source</a></div></div><div class="public anchor" id="var-prolong"><h3>prolong</h3><div class="usage"><code>(prolong src)</code><code>(prolong src ip-address)</code><code>(prolong src session-key ip-address)</code></div><div class="doc"><div class="markdown"><p>Re-validates session by updating its timestamp and re-running validation.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1758">view source</a></div></div><div class="public anchor" id="var-prolonged.3F"><h3>prolonged?</h3><div class="usage"><code>(prolonged? src)</code><code>(prolonged? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session has just been prolonged. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L582">view source</a></div></div><div class="public anchor" id="var-put-var.21"><h3>put-var!</h3><div class="usage"><code>(put-var! src var-name value)</code><code>(put-var! src session-key var-name value)</code></div><div class="doc"><div class="markdown"><p>Puts a session variable <code>var-name</code> with a value <code>value</code> into a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1511">view source</a></div></div><div class="public anchor" id="var-put-vars.21"><h3>put-vars!</h3><div class="usage"><code>(put-vars! src pairs)</code><code>(put-vars! src session-key pairs)</code></div><div class="doc"><div class="markdown"><p>Puts session variables with associated values (<code>var-names-values</code>) expressed as pairs into a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1524">view source</a></div></div><div class="public anchor" id="var-refresh-times"><h3>refresh-times</h3><div class="usage"><code>(refresh-times src)</code><code>(refresh-times src session-key)</code><code>(refresh-times src remote-ip)</code><code>(refresh-times src session-key remote-ip)</code></div><div class="doc"><div class="markdown"><p>Checks a last-active time of the session. If the time left to expiration is smaller than the cache TTL then the session record will be updated using a database query and session cache invalidated for a session ID. Uses pre-calculated value stored in the <code>:cache-margin</code> field of a session record (see <code>calc-cache-margin</code> for more info).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1586">view source</a></div></div><div class="public anchor" id="var-salt-splitter"><h3>salt-splitter</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L691">view source</a></div></div><div class="public anchor" id="var-scrypt-options"><h3>scrypt-options</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L685">view source</a></div></div><div class="public anchor" id="var-secure.3F"><h3>secure?</h3><div class="usage"><code>(secure? src)</code><code>(secure? src session-key)</code></div><div class="doc"><div class="markdown"><p>Checks if a session is secure according to configured security level. If <code>:secured?</code> option is not enabled in configuration, it returns <code>true</code>. If <code>:secure?</code> flag is set to a truthy value, it returns it. If there is no session, it returns <code>false</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L872">view source</a></div></div><div class="public anchor" id="var-security-failed.3F"><h3>security-failed?</h3><div class="usage"><code>(security-failed? src)</code><code>(security-failed? src session-key)</code></div><div class="doc"><div class="markdown"><p>Checks if the additional security token was validated incorrectly unless the session is not secure (in such case it returns <code>false</code>). Does not test if session should be secured; to check it, use <code>secure?</code> or <code>insecure?</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L918">view source</a></div></div><div class="public anchor" id="var-security-passed.3F"><h3>security-passed?</h3><div class="usage"><code>(security-passed? src)</code><code>(security-passed? src session-key)</code></div><div class="doc"><div class="markdown"><p>Checks if the additional security token was validated correctly or there was not a need to validate it because the session is not secure (in such case returns <code>true</code>). Does not test if session should be secured; to check it, use <code>secure?</code> or <code>insecure?</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L902">view source</a></div></div><div class="public anchor" id="var-session-key"><h3>session-key</h3><div class="usage"><code>(session-key src)</code><code>(session-key src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:session-key</code> (session key) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L562">view source</a></div></div><div class="public anchor" id="var-session.3F"><h3>session?</h3><div class="usage"><code>(session? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value <code>v</code> is an instance of <code>Session</code> record.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L55">view source</a></div></div><div class="public anchor" id="var-set-session"><h3>set-session</h3><div class="usage"><code>(set-session opts db table smap)</code></div><div class="doc"><div class="markdown"><p>Puts session data into a database <code>db</code>. Returns the number of updated rows in case of success.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1258">view source</a></div></div><div class="public anchor" id="var-sid-match"><h3>sid-match</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L46">view source</a></div></div><div class="public anchor" id="var-sid-valid"><h3>sid-valid</h3><div class="usage"><code>(sid-valid sid)</code></div><div class="doc"><div class="markdown"><p>Returns the given <code>sid</code> if it is valid after converting it to a string. Otherwise it returns <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L89">view source</a></div></div><div class="public anchor" id="var-sid-valid.3F"><h3>sid-valid?</h3><div class="usage"><code>(sid-valid? sid)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session ID is valid.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L81">view source</a></div></div><div class="public anchor" id="var-soft-expired.3F"><h3>soft-expired?</h3><div class="usage"><code>(soft-expired? src)</code><code>(soft-expired? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given session is marked as soft-expired. The session can be passed directly or as a request map from which it should be extracted (in such case the optional <code>session-key</code> argument may be given).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1033">view source</a></div></div><div class="public anchor" id="var-state"><h3>state</h3><div class="usage"><code>(state smap ip-address)</code></div><div class="doc"><div class="markdown"><p>Returns session state. If there is anything wrong, returns a <code>SessionError</code> record. Otherwise it returns <code>nil</code>. Unknown session detection is performed by checking if a value associated with the <code>:id</code> key is <code>nil</code> and a value associated with the <code>:err-id</code> key is not <code>nil</code>. First argument must be a session object of type <code>Session</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1070">view source</a></div></div><div class="public anchor" id="var-token-splitter"><h3>token-splitter</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L690">view source</a></div></div><div class="public anchor" id="var-update-last-active"><h3>update-last-active</h3><div class="usage"><code>(update-last-active opts db table sid-db remote-ip)</code><code>(update-last-active opts db table sid-db remote-ip t)</code></div><div class="doc"><div class="markdown"><p>Updates session last active time on a database <code>db</code>. Returns the number of updated rows in case of success.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1248">view source</a></div></div><div class="public anchor" id="var-user-email"><h3>user-email</h3><div class="usage"><code>(user-email src)</code><code>(user-email src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:user-email</code> (user e-mail) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L522">view source</a></div></div><div class="public anchor" id="var-user-id"><h3>user-id</h3><div class="usage"><code>(user-id src)</code><code>(user-id src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:user-id</code> (user ID) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L512">view source</a></div></div><div class="public anchor" id="var-valid-of"><h3>valid-of</h3><div class="usage"><code>(valid-of src)</code><code>(valid-of src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns a session if <code>src</code> contains a session or is a session, and the session is valid. Optional <code>session-key</code> may be given to express a key in associative structure (defaults to <code>:session</code>). Returns <code>nil</code> if session is not valid.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L434">view source</a></div></div><div class="public anchor" id="var-valid.3F"><h3>valid?</h3><div class="usage"><code>(valid? src)</code><code>(valid? src session-key)</code></div><div class="doc"><div class="markdown"><p>Returns the <code>:valid?</code> (validity) property of a session. The <code>src</code> can be a session record (<code>Session</code>) or any object which satisfies the <code>Sessionable</code> protocol and can be converted to a session. Optional <code>session-key</code> can be given when passing a request map. If there is no session, returns <code>false</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1123">view source</a></div></div><div class="public anchor" id="var-when-sid-valid"><h3>when-sid-valid</h3><h4 class="type">macro</h4><div class="usage"><code>(when-sid-valid sid & body)</code></div><div class="doc"><div class="markdown"><p>Conditionally evaluates expressions from <code>body</code> in an implicit <code>do</code> when the session ID given as <code>sid</code> is valid. Otherwise it returns <code>nil</code> without evaluating anything.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L95">view source</a></div></div><div class="public anchor" id="var-wrap-session"><h3>wrap-session</h3><div class="usage"><code>(wrap-session k config)</code></div><div class="doc"><div class="markdown"><p>Session maintaining middleware.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/session.clj#L1906">view source</a></div></div></div></body></html>