Skip to content

Commit a9a8864

Browse files
committed
Release 2.24
1 parent 10d7a3f commit a9a8864

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

Changes.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `lua-resty-session` will be documented in this file.
44

5+
## [2.24] - Upcoming
6+
### Fixed
7+
- Avoid use unix socket and redis password with empty string
8+
- Provide session id when closing, otherwise the lock is not deleted
9+
10+
### Added
11+
- Added a configuration for session cookie max size (`session.cookie.maxsize`)
12+
513
## [2.23] - 2018-12-12
614
### Added
715
- Added pluggable strategies with `default` and a new `regenerate` strategy

README.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@ local uid = session.data.uid
800800

801801
#### boolean session.cookie.persistent
802802

803-
`session.cookie.persistent` is by default `false`. This means that cookies are not persisted between browser sessions (i.e. they are deleted when the browser is closed). You can enable persistent sessions if you want to by setting this to `true`. This can be configured with Nginx `set $session_cookie_persistent on;`.
803+
`session.cookie.persistent` is by default `false`. This means that cookies are not persisted between browser sessions
804+
(i.e. they are deleted when the browser is closed). You can enable persistent sessions if you want to by setting this
805+
to `true`. This can be configured with Nginx `set $session_cookie_persistent on;`.
804806

805807
#### number session.cookie.discard
806808

@@ -820,7 +822,8 @@ with Nginx `set $session_cookie_renew 600;` (600 seconds is the default value).
820822
`session.cookie.lifetime` holds the cookie lifetime in seconds in the future. By default this is set
821823
to 3,600 seconds. This can be configured with Nginx `set $session_cookie_lifetime 3600;`. This does not
822824
set cookie's expiration time on session only (by default) cookies, but it is used if the cookies are
823-
configured persistent with `session.cookie.persistent == true`. See also notes about [ssl_session_timeout](#nginx-configuration-variables).
825+
configured persistent with `session.cookie.persistent == true`. See also notes about
826+
[ssl_session_timeout](#nginx-configuration-variables).
824827

825828
#### string session.cookie.path
826829

@@ -862,6 +865,14 @@ want to turn this off, this can be configured with Nginx `set $session_cookie_ht
862865
delimited. By default it is a pipe character, `|`. It is up to storage adapter to decide if this configuration
863866
parameter is used.
864867

868+
#### string session.cookie.maxsize
869+
870+
`session.cookie.maxsize` is used to configure maximum size of a single cookie. This value is used to split a
871+
large cookie into chunks. By default it is `4000` bytes of serialized and encoded data which does not count
872+
the cookie name and cookie flags. If you expect your cookies + flags be more than e.g. `4096` bytes, you
873+
should reduce the `session.cookie.maxsize` so that a single cookie fits into `4096` bytes because otherwise
874+
the user-agent may ignore the cookie (being too big).
875+
865876
#### number session.cookie.chunks
866877

867878
`session.cookie.chunks` should be used as a read only property to determine how many separate cookies was
@@ -872,10 +883,10 @@ of data in session, then the cookie is divided to `n` chunks where each stores d
872883
#### boolean session.check.ssi
873884

874885
`session.check.ssi` is additional check to validate that the request was made with the same SSL
875-
session as when the original cookie was delivered. This check is enabled by default on releases prior 2.12 on non-persistent
876-
sessions and disabled by default on persistent sessions and on releases 2.12 and later. Please note that on TLS with TLS Tickets enabled,
877-
this will be empty) and not used. This is discussed on issue #5 (https://github.com/bungle/lua-resty-session/issues/5).
878-
You can disable TLS tickets with Nginx configuration:
886+
session as when the original cookie was delivered. This check is enabled by default on releases prior 2.12
887+
on non-persistent sessions and disabled by default on persistent sessions and on releases 2.12 and later.
888+
Please note that on TLS with TLS Tickets enabled, this will be empty) and not used. This is discussed on issue #5
889+
(https://github.com/bungle/lua-resty-session/issues/5). You can disable TLS tickets with Nginx configuration:
879890

880891
```nginx
881892
ssl_session_tickets off;
@@ -935,9 +946,9 @@ and `session.start`).
935946
Please note that Nginx has also its own SSL/TLS caches and timeouts. Especially note `ssl_session_timeout` if you
936947
are running services over SSL/TLS as this will end sessions regardless of `session.cookie.lifetime`. Please adjust
937948
that accordingly or disable `ssl_session_id` check `session.check.ssi = false` (in code) or
938-
`set $session_check_ssi off;` (in Nginx configuration). As of 2.12 checking SSL session identifier check (`$session_check_ssi` / `session.check.ssi`)
939-
is disabled by default because it was not reliable (most servers use session tickets now), and it usually needed
940-
extra configuration.
949+
`set $session_check_ssi off;` (in Nginx configuration). As of 2.12 checking SSL session identifier check
950+
(`$session_check_ssi` / `session.check.ssi`) is disabled by default because it was not reliable (most servers use
951+
session tickets now), and it usually needed extra configuration.
941952

942953
You may want to add something like this to your Nginx SSL/TLS config (quite a huge cache in this example, 1 MB is
943954
about 4.000 SSL sessions):
@@ -982,6 +993,7 @@ set $session_cookie_samesite Lax;
982993
set $session_cookie_secure on;
983994
set $session_cookie_httponly on;
984995
set $session_cookie_delimiter |;
996+
set $session_cookie_maxsize 4000;
985997
set $session_check_ssi off;
986998
set $session_check_ua on;
987999
set $session_check_scheme on;

lib/resty/session.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ local function init()
202202
end
203203

204204
local session = {
205-
_VERSION = "2.23"
205+
_VERSION = "2.24"
206206
}
207207

208208
session.__index = session

0 commit comments

Comments
 (0)