From ce6f19871c3ea1ce6038a56edf2ba8ad5b5c1425 Mon Sep 17 00:00:00 2001 From: maxin Date: Sat, 6 Aug 2016 21:13:58 +0800 Subject: [PATCH] Refactoring --- context/output.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/context/output.go b/context/output.go index e1ad23e0..78804e42 100644 --- a/context/output.go +++ b/context/output.go @@ -146,18 +146,12 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface } // default false. for session cookie default true - httponly := false if len(others) > 4 { if v, ok := others[4].(bool); ok && v { - // HttpOnly = true - httponly = true + fmt.Fprintf(&b, "; HttpOnly") } } - if httponly { - fmt.Fprintf(&b, "; HttpOnly") - } - output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String()) }