您可能需要在选项中定义cookie的路径。以下选项struct应该可以解决问题:
session.Options = &sessions.Options{ Path: "/performance",}对于整个页面的使用,上述选项将cookie的可用性限制为给定的路径
"/"。
请注意,IE不支持该
max-age设置:
[…] Internet Explorer(包括IE8)不尝试支持cookie的任何RFC。WinINET(IE下的网络堆栈)具有基于RFC
Netscape之前的cookie草案规范的cookie实现。这意味着在Internet Explorer的任何版本中均不支持max-
age,版本化cookie等指令。
顺便说一句,您不需要
MaxAge会话cookie(来自IE的cookie手册):
(expires=date;) If you set no expiration date on a cookie, it expires when the browser closes. If you set an expiration date, the cookie is saved across browser sessions. If you set an expiration date in the past, the cookie is deleted. Use Greenwich Mean Time (GMT) format to specify the date.
所有主要的浏览器都应该如此。



