git.iko.soy/typeable/oauth2-proxy
on master help sign in
Warn users when session cookies are split
commitfcd52e042e05ca5ac68ca8a858931b820f8dae06 authorJoel Speed <joel.speed@hotmail.co.uk> dateFri 10 Apr 2020, 14:25 (7 years ago) parenta659b95
2 files changed+3
CHANGELOG.md+1 pkg/sessions/cookie/session_store.go+2
CHANGELOG.md+1
@@ -35,6 +35,7 @@
3535- [#462](https://github.com/oauth2-proxy/oauth2-proxy/pull/462) Allow HTML in banner message (@eritikass).
3636- [#412](https://github.com/pusher/oauth2_proxy/pull/412) Allow multiple cookie domains to be specified (@edahlseng)
3737- [#413](https://github.com/oauth2-proxy/oauth2-proxy/pull/413) Add -set-basic-auth param to set the Basic Authorization header for upstreams (@morarucostel).
38+- [#483](https://github.com/oauth2-proxy/oauth2-proxy/pull/483) Warn users when session cookies are split (@JoelSpeed)
3839
3940# v5.1.0
4041
pkg/sessions/cookie/session_store.go+2
@@ -12,6 +12,7 @@ import (
1212 "github.com/oauth2-proxy/oauth2-proxy/pkg/apis/sessions"
1313 "github.com/oauth2-proxy/oauth2-proxy/pkg/cookies"
1414 "github.com/oauth2-proxy/oauth2-proxy/pkg/encryption"
15+ "github.com/oauth2-proxy/oauth2-proxy/pkg/logger"
1516 "github.com/oauth2-proxy/oauth2-proxy/pkg/sessions/utils"
1617)
1718
@@ -129,6 +130,7 @@ func NewCookieSessionStore(opts *options.SessionOptions, cookieOpts *options.Coo
129130// it into a slice of cookies which fit within the 4kb cookie limit indexing
130131// the cookies from 0
131132func splitCookie(c *http.Cookie) []*http.Cookie {
133+ logger.Printf("WARNING: Multiple cookies are required for this session as it exceeds the 4kb cookie limit. Please use server side session storage (eg. Redis) instead.")
132134 if len(c.Value) < maxCookieLength {
133135 return []*http.Cookie{c}
134136 }