Skip to content

Conversation

JoelSpeed
Copy link
Member

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:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

// 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).")
Copy link
Contributor

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?

Copy link
Member Author

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? 🤔

// 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).")
Copy link
Contributor

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:

Suggested change
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")

@JoelSpeed
Copy link
Member Author

@syscll Applied your suggestion

@steakunderscore steakunderscore merged commit 4341ab4 into master Apr 12, 2020
@steakunderscore steakunderscore deleted the split-warning branch April 12, 2020 11:36
Jing-ze pushed a commit to Jing-ze/oauth2-proxy that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants