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

Comments

Projects
None yet
3 participants
@srittau
Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.