You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use this Lua library with NGINX, ensure that [nginx-module-lua](../modules/lua.md) is installed.
34
34
35
-
This document describes lua-resty-session [v4.0.5](https://github.com/bungle/lua-resty-session/releases/tag/v4.0.5){target=_blank}
36
-
released on Aug 16 2023.
35
+
This document describes lua-resty-session [v4.1.1](https://github.com/bungle/lua-resty-session/releases/tag/v4.1.1){target=_blank}
36
+
released on Apr 16 2025.
37
37
38
38
<hr />
39
39
@@ -42,9 +42,10 @@ released on Aug 16 2023.
42
42
## TL;DR;
43
43
44
44
- Sessions are immutable (each save generates a new session), and lockless.
45
-
- Session data is AES-256-GCM encrypted with a key derived using HKDF-SHA256.
45
+
- Session data is AES-256-GCM encrypted with a key derived using HKDF-SHA256
46
+
(on FIPS-mode it uses PBKDF2 with SHA-256 instead.
46
47
- Session has a fixed size header that is protected with HMAC-SHA256 MAC with
47
-
a key derived using HKDF-SHA256.
48
+
a key derived using HKDF-SHA256 (on FIPS-mode it uses PBKDF2 with SHA-256 instead).
48
49
- Session data can be stored in a stateless cookie or in various backend storages.
49
50
- A single session cookie can maintain multiple sessions across different audiences.
50
51
@@ -251,6 +252,7 @@ Here are the possible session configuration options:
251
252
|`cookie_prefix`|`nil`| Cookie prefix, use `nil`, `"__Host-"` or `"__Secure-"`. |
252
253
|`cookie_name`|`"session"`| Session cookie name, e.g. `"session"`. |
253
254
|`cookie_path`|`"/"`| Cookie path, e.g. `"/"`. |
255
+
|`cookie_domain`|`nil`| Cookie domain, e.g. `"example.com"`|
254
256
|`cookie_http_only`|`true`| Mark cookie HTTP only, use `true` or `false`. |
255
257
|`cookie_secure`|`nil`| Mark cookie secure, use `nil`, `true` or `false`. |
256
258
|`cookie_priority`|`nil`| Cookie priority, use `nil`, `"Low"`, `"Medium"`, or `"High"`. |
@@ -274,6 +276,7 @@ Here are the possible session configuration options:
274
276
|`store_metadata`|`false`| Whether to also store metadata of sessions, such as collecting data of sessions for a specific audience belonging to a specific subject. |
275
277
|`touch_threshold`|`60`| Touch threshold controls how frequently or infrequently the `session:refresh` touches the cookie, e.g. `60` (a minute) (in seconds) |
276
278
|`compression_threshold`|`1024`| Compression threshold controls when the data is deflated, e.g. `1024` (a kilobyte) (in bytes), `0` disables compression. |
279
+
|`bind`|`nil`| Bind the session to data acquired from the HTTP request or connection, use `ip`, `scheme`, `user-agent`. E.g. `{ "scheme", "user-agent" }` will calculate MAC utilizing also HTTP request `Scheme` and `User-Agent` header. |
277
280
|`request_headers`|`nil`| Set of headers to send to upstream, use `id`, `audience`, `subject`, `timeout`, `idling-timeout`, `rolling-timeout`, `absolute-timeout`. E.g. `{ "id", "timeout" }` will set `Session-Id` and `Session-Timeout` request headers when `set_headers` is called. |
278
281
|`response_headers`|`nil`| Set of headers to send to downstream, use `id`, `audience`, `subject`, `timeout`, `idling-timeout`, `rolling-timeout`, `absolute-timeout`. E.g. `{ "id", "timeout" }` will set `Session-Id` and `Session-Timeout` response headers when `set_headers` is called. |
279
282
|`storage`|`nil`| Storage is responsible of storing session data, use `nil` or `"cookie"` (data is stored in cookie), `"dshm"`, `"file"`, `"memcached"`, `"mysql"`, `"postgres"`, `"redis"`, or `"shm"`, or give a name of custom module (`"custom-storage"`), or a `table` that implements session storage interface. |
0 commit comments