douyinzha5820
2015-04-07 19:36
浏览 274
已采纳

如何使用Go和http包删除Cookie?

A user has a cookie set when they visit using http.SetCookie like so:

expire := time.Now().Add(7 * 24 * time.Hour)
cookie := http.Cookie{
    Name:    "name",
    Value:   "value",
    Expires: expire,
}
http.SetCookie(w, &cookie)

If I want to remove this cookie at a later point, what is the correct way to do this?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题