alexedwards / scs

HTTP Session Management for Go
MIT License
2.13k stars 166 forks source link

Get compile error undefined: http.SameSite #60

Closed jayeshnachnani closed 5 years ago

jayeshnachnani commented 5 years ago

I am new to golang, using go1.10 and trying to compile

I get undefined: http.SameSite error during compiliation

Stackoverflow seems to suggest that it is because of go version, although this is unconfirmed

https://stackoverflow.com/questions/55895541/encountered-an-error-samesite-http-samesitelaxmode

alexedwards commented 5 years ago

Yes, it requires Go 1.11 (see https://github.com/alexedwards/scs#compatibility).

This is because it sets the SameSite attribute on the session cookie for additional security, but that attribute is only supported in 1.11 onwards.

I'll update the readme to make this clearer right at the top.

jayeshnachnani commented 5 years ago

thanks a lot for the quickest response possible!

Yes I read up the below link as well, the SameSite attribute itself is newish and therefore newish in Go!

https://medium.com/compass-security/samesite-cookie-attribute-33b3bfeaeb95