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

parse_cookie(): Does not ignore empty cookies #1245

Closed
srittau opened this issue Jan 24, 2018 · 2 comments
Closed

parse_cookie(): Does not ignore empty cookies #1245

srittau opened this issue Jan 24, 2018 · 2 comments

Comments

@srittau
Copy link
Contributor

@srittau srittau commented Jan 24, 2018

parse_cookie("foo=bar; ; abc=def")
{'foo': 'bar', '; abc': 'def'}

As you can see, instead of a cookie named abc, there is one named ; abc. I came across this problem when I accidentally added an empty cookie in Chrome by calling document.cookie = "" from Javascript. Chrome then sent a Cookie header similar to the one above, which caused another cookie not to be found anymore.

@davidism
Copy link
Member

@davidism davidism commented Jan 24, 2018

Are you using the latest version of Werkzeug? Similar to #1118, although I'm not sure if completely empty keys were addressed. If they weren't a similar fix should be pretty straightforward, if you can submit one.

@yanigisawa
Copy link
Contributor

@yanigisawa yanigisawa commented May 14, 2018

#1301 submitted to address the empty segment issue. Travis CI build failed presumably from a timing issue.

yanigisawa added a commit to yanigisawa/werkzeug that referenced this issue May 15, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants