Skip to content
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

refactor CookieOverflow #761

Merged
merged 1 commit into from May 8, 2019

Conversation

skojin
Copy link
Contributor

@skojin skojin commented Apr 15, 2019

Check cookie size when set it, not in middleware

Purpose

Instead of check cookie size at end of request in middleware check it when set it.

Description

Two props:

  1. more simple code
  2. error stack trace will show place where bad cookie was set

Extra

Rails do in same way, check when cookie is set. One difference rails check size only of encrypted/signed cookies. Plain cookies size not checked.

In this commit I still check size of all cookies, encrypted and raw.
Possible we not need to check size of raw cookies.

Check cookie size when set it, not in middleware
@paulcsmith
Copy link
Member

Thank you so much for handling this! I'll merge for now and see if I can test it out and make sure it all works in production apps. It can be tricky to handle edge cases in cookie :P

@jwoertink would you mind giving this a try one some of your projects to make sure cookies are still working correctly?

@paulcsmith paulcsmith merged commit 3745f4a into luckyframework:master May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants