diff options
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 } |