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

Set the cookie attribute “SameSite = None” #1934

Closed
vsubramoney opened this issue Jun 7, 2019 · 5 comments
Closed

Set the cookie attribute “SameSite = None” #1934

vsubramoney opened this issue Jun 7, 2019 · 5 comments

Comments

@vsubramoney
Copy link

vsubramoney commented Jun 7, 2019

  • With issues:

    • Use the search tool before opening a new issue.
    • Please provide source code and commit sha if you found a bug.
    • Review existing issues and provide feedback or react to them.
  • go version: go1.12.5

  • gin version (or commit ref):

  • operating system: windows/amd64

Description

Compilation fails with the error undefined: http.SameSiteNoneMode
when I set the value of SameSite to http.SameSiteNoneMode

newCookie := &http.Cookie{
				Name:     MatchCookieName,
				Domain:   GetRootDomain(r),
				MaxAge:   CookieMaxAge,
				Expires:  time.Now().Add(CookieMaxAge),
				Value:    matchCookieAfter.EncodeToBase64(),
				SameSite: http.SameSiteNoneMode,
				Secure:   true,
				Path:     "/",
}

Golang right now supports the following values for SameSite Cookie attribute
http.SameSiteLaxMode, http.SameSiteStrictMode, http.SameSiteDefaultMode. A 4th value SameSiteNoneMode should be added to support Chrome release of version 76 in July 2019.

@thinkerou
Copy link
Member

maybe you should see #1615 thanks!

@vsubramoney
Copy link
Author

I checked #1615, there is no mention of None. I only see the changes for 'Lax' and 'Strict'. "None" is a constant that should be added to support the upcoming google chrome version 76.

@roychowdhuryrohit-dev
Copy link

maybe you should see #1615 thanks!

Is it feature merged with gin framework ? I checked the doc and there's no feature for setting SameSite attribute for cookie in Gin.

@aurel-bo
Copy link

aurel-bo commented Jan 20, 2020

Any updates on this? Just ran into the same issue: SameSite: http.SameSiteLaxMode works while SameSite:SameSiteNoneMode doesn't.

@thinkerou
Copy link
Member

#1615 merged!

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

4 participants