Please excuse if my explanation was misleading.
As you know there are two ways to specify the lifetime of a persistent cookie:
MaxAge and Expires. Expires is nasty and sometimes unreliable (think of
server and client disagreeing on the current time). To overcome these
nastiness MaxAge was introduced and is understood by every browser.
MaxAge is much easier to use and free form several problems Expires has.
That's why I'd like to recommend MaxAge, regardless of any potential
bugs with time formating.
Regarding your objection to time.Format and the timezone and how this
all interplays when crafting an Expires attribute of a cookie:
1. Note that a Go time.Time carries a location, a timezone.
2. As others have pointed out already Time.Format just does printing,
and does not do any conversions, not even timezone conversions.
3. One of the nastinesses of Expires is that it _has_ to be in GMT, no
arguing here, that is what the RFCs for HTTP define.
So you have to convert your time to UTC (=GMT) and then print it.
There is no bug, it is just the case that Expires is complicated.
That's why I recommended using MaxAge.
V.