package main import ( "net/http" "time" ) func main() { cookieName := "session" cookieValue := "123456" cookiePath := "/" cookieDomain := "example.com" cookieExpires := time.Now().Add(24 * time.Hour) cookieHttpOnly := true // Create a new cookie with the given values cookie := http.Cookie{ Name: cookieName, Value: cookieValue, Path: cookiePath, Domain: cookieDomain, Expires: cookieExpires, HttpOnly: cookieHttpOnly, } // Set the cookie in the response http.SetCookie(w, &cookie) }In this example, a new cookie is created with a name of "session", a value of "123456", and a number of other properties such as the path, domain, expiration date, and HttpOnly flag. The cookie is then set in the response using the `http.SetCookie` function. Package library: net/http.