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

Rewrite cookie generation to use Web.Cookie and generate spec conforming cookie headers #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmk
Copy link

@nmk nmk commented Feb 26, 2018

Currently, servant-auth-cookie generates invalid cookies which fail on some browsers. The error is in the rendering of the previously available acsCookieFlags field. It resulted in cookies which look like
name=value;HttpOnly=;Secure=;SameSite. This failed to set a cookie for me on Chrome 64.0.3282.186 on OS X. Firefox and Safari seem to be more lenient in their cookie parsing and parsed the cookie successfully. In any case, if I read the spec correctly, the above should be name=value;HttpOnly;Secure;SameSite (not the missing equals signs).

As this package already leverages Web.Cookie from the cookie package, I rewrote the rendering code to use the provided functions, which results in spec conforming cookies. This required the addition of specific fields for the HttpOnly, Secure and SameSite options in AuthCookieSettings type. I have added the fields in the default instance, so the tests continue to run. I am not sure what to do with the version number though - I will leave it up to you, as this might break user code if they were using the acsCookieFlags field.

- Format cookie flags correctly
- Bump stack resolver for cookie-0.4.3
@kristoff3r
Copy link

This is much better than my pull request, +1

@afcady
Copy link

afcady commented Sep 1, 2018

So why wasn't this merged? Is this package abandoned?

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

3 participants