Manage session time fields centrally

This commit is contained in:
Nick Meves
2021-06-21 21:54:52 -07:00
parent 7e80e5596b
commit 7fa6d2d024
11 changed files with 91 additions and 64 deletions
+1 -2
View File
@@ -30,8 +30,7 @@ func NewManager(store Store, cookieOpts *options.Cookie) *Manager {
// from the persistent data store.
func (m *Manager) Save(rw http.ResponseWriter, req *http.Request, s *sessions.SessionState) error {
if s.CreatedAt == nil || s.CreatedAt.IsZero() {
now := time.Now()
s.CreatedAt = &now
s.CreatedAtNow()
}
tckt, err := decodeTicketFromRequest(req, m.Options)