Created
August 1, 2017 21:32
-
-
Save kalbasit/23835630ef5441056b653f8b28bc58b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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