1. 设置Cookie
  2. cookie := http.Cookie{Name: "testcookiename", Value: "testcookievalue", Path: "/", MaxAge: 86400}
  3. http.SetCookie(w, &cookie)
  4. 读取Cookie
  5. cookie, err := req.Cookie("testcookiename")
  6. 删除Cookie
  7. cookie := http.Cookie{Name: "testcookiename", Path: "/", MaxAge: -1}
  8. http.SetCookie(w, &cookie)

分类: web

标签:   golang