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

Add support for SameSite option #28

Open
lakhansamani opened this issue Apr 8, 2020 · 0 comments
Open

Add support for SameSite option #28

lakhansamani opened this issue Apr 8, 2020 · 0 comments

Comments

@lakhansamani
Copy link

How it affects

With the new chrome versions, it will be only supporting Strict mode for cookies, i.e. SameSite=Lax we need to manually set SameSite=None if we want our APIs to work with different domains.

Ref: https://www.chromestatus.com/feature/5633521622188032

Currently, the library is not supporting SameSite option. This is part of net/http package and should be supported

Example

cookie := http.Cookie{
	Name:     "my-cookie",
	Value:     "token"
	Domain:   domain,
	Path:     "/",
	MaxAge:   30 * 60 * 60 * 24,
	Expires:  time.Now().Add(30 * 24 * time.Hour),
	Secure:   false,
	SameSite: http.SameSiteNoneMode,
}

Also, something to note http.SameSiteNoneMode constant is introduced with Golang v1.13.0 only.

Expected outcome:

There should be a way to configure SameSite option

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

No branches or pull requests

1 participant