-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Warn users when session cookies are split #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7ef8613
to
5ddd307
Compare
pkg/sessions/cookie/session_store.go
Outdated
// it into a slice of cookies which fit within the 4kb cookie limit indexing | ||
// the cookies from 0 | ||
func splitCookie(c *http.Cookie) []*http.Cookie { | ||
logger.Printf("WARNING: Sessions exceeds 4kb cookie limit. Multiple cookies are required for this session. Please use server side session storage (eg. Redis).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about change WARNING
to DEPRECATED
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that we haven't officially decided to deprecate yet, so shouldn't say it's deprecated? I was thinking we would add deprecated once we have gathered more feedback, though, changing it now, might make it easier to get feedback? 🤔
pkg/sessions/cookie/session_store.go
Outdated
// it into a slice of cookies which fit within the 4kb cookie limit indexing | ||
// the cookies from 0 | ||
func splitCookie(c *http.Cookie) []*http.Cookie { | ||
logger.Printf("WARNING: Sessions exceeds 4kb cookie limit. Multiple cookies are required for this session. Please use server side session storage (eg. Redis).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this reads better:
logger.Printf("WARNING: Sessions exceeds 4kb cookie limit. Multiple cookies are required for this session. Please use server side session storage (eg. Redis).") | |
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") |
5ddd307
to
fcd52e0
Compare
@syscll Applied your suggestion |
Description
Adds a warning to users when sessions are being split, recommending them to use a server side session storage implementation such as redis
Motivation and Context
To start potential changes inferred by #482
How Has This Been Tested?
Not tested but a minor change that shouldn't need much in the way of testing
Checklist: