aboutsummaryrefslogtreecommitdiff
path: root/sessions.go
diff options
context:
space:
mode:
authorHank Shen <swhbox@foxmail.com>2020-06-15 11:11:28 +0300
committerHank Shen <swhbox@foxmail.com>2020-06-15 11:11:28 +0300
commit61ae93e6ea22407566ba751bae9ef079f89aa646 (patch)
tree8884139296a66c6f15eb0c60aef0577a02b4ef71 /sessions.go
parent90473594ee0f2e4dc1c06b0d47b0f98510df3c92 (diff)
update
Diffstat (limited to 'sessions.go')
-rw-r--r--sessions.go3
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...)
}