Skip to content

Commit 73cc7f1

Browse files
committed
2.4.15.6: use SameSite=Lax when OIDCCookieSameSite is On
(also by default) instead of Strict as overriding from Lax to Strict does not work reliably anymore (Chrome) Signed-off-by: Hans Zandbelt <[email protected]>
1 parent b696f3d commit 73cc7f1

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
- fix userinfo refresh interval parsing; closes #1200; thanks @HolgerHees
33
avoid refreshing userinfo on each request until access token expiry
44
- store interval as JSON integer in session
5+
- use SameSite=Lax when OIDCCookieSameSite is On (also by default) instead of
6+
Strict as overriding from Lax to Strict does not work reliably anymore (Chrome)
57
- release 2.4.15.6
68

79
03/13/2024

auth_openidc.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
# Defines whether the SameSite flag will be set on cookies.
529529
# When On the following will apply:
530530
# state cookie: Lax
531-
# session cookie: first time set Lax, updates (e.g. after inactivity timeout) Strict
531+
# session cookie: Lax
532532
# x_csrf discovery: Strict:
533533
#
534534
# The default `SameSite=None` cookie appendix on `Set-Cookie` response headers can be

src/session.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ static apr_byte_t oidc_session_save_cache(request_rec *r, oidc_session_t *z, apr
204204
/* set the uuid in the cookie */
205205
oidc_http_set_cookie(
206206
r, oidc_cfg_dir_cookie(r), z->uuid, c->persistent_session_cookie ? z->expiry : -1,
207-
c->cookie_same_site
208-
? (first_time ? OIDC_COOKIE_EXT_SAME_SITE_LAX : OIDC_COOKIE_EXT_SAME_SITE_STRICT)
209-
: OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r));
207+
c->cookie_same_site ? OIDC_COOKIE_EXT_SAME_SITE_LAX : OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r));
210208

211209
} else {
212210

@@ -242,12 +240,11 @@ static apr_byte_t oidc_session_save_cookie(request_rec *r, oidc_session_t *z, ap
242240
if ((z->state != NULL) && (oidc_session_encode(r, c, z, &cookieValue, TRUE) == FALSE))
243241
return FALSE;
244242

245-
oidc_http_set_chunked_cookie(
246-
r, oidc_cfg_dir_cookie(r), cookieValue, c->persistent_session_cookie ? z->expiry : -1,
247-
c->session_cookie_chunk_size,
248-
(z->state == NULL) ? OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r)
249-
: c->cookie_same_site ? (first_time ? OIDC_COOKIE_EXT_SAME_SITE_LAX : OIDC_COOKIE_EXT_SAME_SITE_STRICT)
250-
: OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r));
243+
oidc_http_set_chunked_cookie(r, oidc_cfg_dir_cookie(r), cookieValue,
244+
c->persistent_session_cookie ? z->expiry : -1, c->session_cookie_chunk_size,
245+
(z->state == NULL) ? OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r)
246+
: c->cookie_same_site ? OIDC_COOKIE_EXT_SAME_SITE_LAX
247+
: OIDC_COOKIE_EXT_SAME_SITE_NONE(c, r));
251248

252249
return TRUE;
253250
}

0 commit comments

Comments
 (0)