diff options
Diffstat (limited to 'pkg/web/cookie/option.go')
| -rw-r--r-- | pkg/web/cookie/option.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/web/cookie/option.go b/pkg/web/cookie/option.go index 3f2cc93..58a2e93 100644 --- a/pkg/web/cookie/option.go +++ b/pkg/web/cookie/option.go @@ -50,7 +50,8 @@ func WithExpiration(expires time.Time) x.Option[*http.Cookie] { if expires.Before(time.Now()) { c.MaxAge = -1 } else { - c.MaxAge = int(time.Until(expires).Seconds()) + duration := time.Until(expires).Round(time.Second) + c.MaxAge = int(duration.Seconds()) } }) } |
