Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Created August 1, 2017 21:32
Show Gist options
  • Save kalbasit/23835630ef5441056b653f8b28bc58b8 to your computer and use it in GitHub Desktop.
Save kalbasit/23835630ef5441056b653f8b28bc58b8 to your computer and use it in GitHub Desktop.
package main
import "net/http"
func main() {
http.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Set-Cookie", (&http.Cookie{
Name: "TestCookie",
Value: "domain 1",
Path: "/",
Domain: "domain1.com",
}).String())
w.Header().Add("Set-Cookie", (&http.Cookie{
Name: "TestCookie",
Value: "domain 2",
Path: "/",
Domain: "domain2.com",
}).String())
}))
http.ListenAndServe(":8051", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment