From e76423e6dc646c6caa77618282fd7ffebd7a2241 Mon Sep 17 00:00:00 2001 From: astaxie Date: Sun, 30 Apr 2017 23:59:38 +0800 Subject: [PATCH] revert #2518, fix #2605 --- context/output.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/output.go b/context/output.go index c15f9fe7..564ef96d 100644 --- a/context/output.go +++ b/context/output.go @@ -105,7 +105,7 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface switch { case maxAge > 0: fmt.Fprintf(&b, "; Expires=%s; Max-Age=%d", time.Now().Add(time.Duration(maxAge)*time.Second).UTC().Format(time.RFC1123), maxAge) - case maxAge <= 0: + case maxAge < 0: fmt.Fprintf(&b, "; Max-Age=0") } }