diff options
author | Hank Shen <swhbox@foxmail.com> | 2020-06-15 11:11:28 +0300 |
---|---|---|
committer | Hank Shen <swhbox@foxmail.com> | 2020-06-15 11:11:28 +0300 |
commit | 61ae93e6ea22407566ba751bae9ef079f89aa646 (patch) | |
tree | 8884139296a66c6f15eb0c60aef0577a02b4ef71 | |
parent | 90473594ee0f2e4dc1c06b0d47b0f98510df3c92 (diff) |
update
-rw-r--r-- | sessions.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sessions.go b/sessions.go index dc65b9e..2f20258 100644 --- a/sessions.go +++ b/sessions.go @@ -195,6 +195,9 @@ func NewCookie(ctx echo.Context, name, value string) *http.Cookie { // SetCookie for echo // @param:ctx,key,value,maxAge(seconds),path(/),domain,secure,httpOnly,sameSite(lax/strict/default) func SetCookie(ctx echo.Context, key string, value string, args ...interface{}) { + if len(args) == 0 { + args = append(args, ctx.CookieOptions()) + } ctx.SetCookie(key, value, args...) } |