diff options
author | Hank Shen <swhbox@foxmail.com> | 2020-06-15 11:00:32 +0300 |
---|---|---|
committer | Hank Shen <swhbox@foxmail.com> | 2020-06-15 11:00:32 +0300 |
commit | 90473594ee0f2e4dc1c06b0d47b0f98510df3c92 (patch) | |
tree | 171c801651a733c714dcfc243e0a5ef4ba4aa2a3 /store.go | |
parent | 903fdb004a08f8f0952487a2e329aa2373a1bd8c (diff) |
update
Diffstat (limited to 'store.go')
-rw-r--r-- | store.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -30,7 +30,8 @@ type Store interface { New(ctx echo.Context, name string) (*Session, error) // Save should persist session to the underlying store implementation. - Save(ctx echo.Context, s *Session) error + // @param args:maxAge(seconds),path(/),domain,secure,httpOnly,sameSite(lax/strict/default) + Save(ctx echo.Context, s *Session, args ...interface{}) error } // CookieStore ---------------------------------------------------------------- @@ -95,13 +96,13 @@ func (s *CookieStore) New(ctx echo.Context, name string) (*Session, error) { } // Save adds a single session to the response. -func (s *CookieStore) Save(ctx echo.Context, session *Session) error { +func (s *CookieStore) Save(ctx echo.Context, session *Session, args ...interface{}) error { encoded, err := securecookie.EncodeMulti(session.Name(), session.Values, s.Codecs...) if err != nil { return err } - SetCookie(ctx, session.Name(), encoded) + SetCookie(ctx, session.Name(), encoded, args...) return nil } @@ -189,8 +190,7 @@ func (s *FilesystemStore) New(ctx echo.Context, name string) (*Session, error) { } // Save adds a single session to the response. -func (s *FilesystemStore) Save(ctx echo.Context, - session *Session) error { +func (s *FilesystemStore) Save(ctx echo.Context, session *Session, args ...interface{}) error { // Delete if max-age is < 0 if ctx.CookieOptions().MaxAge < 0 { if err := s.erase(session); err != nil { @@ -214,7 +214,7 @@ func (s *FilesystemStore) Save(ctx echo.Context, if err != nil { return err } - SetCookie(ctx, session.Name(), encoded) + SetCookie(ctx, session.Name(), encoded, args...) return nil } |