Skip to content

Commit

Permalink
Format expiry time to UTC and 2006-01-02T15:04:05.999 before commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexedwards committed Oct 22, 2023
1 parent a803960 commit 84bd122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlite3store/sqlite3store.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (p *SQLite3Store) Find(token string) (b []byte, exists bool, err error) {
// given expiry time. If the session token already exists, then the data and expiry
// time are updated.
func (p *SQLite3Store) Commit(token string, b []byte, expiry time.Time) error {
_, err := p.db.Exec("REPLACE INTO sessions (token, data, expiry) VALUES ($1, $2, julianday($3))", token, b, expiry)
_, err := p.db.Exec("REPLACE INTO sessions (token, data, expiry) VALUES ($1, $2, julianday($3))", token, b, expiry.UTC().Format("2006-01-02T15:04:05.999"))
if err != nil {
return err
}
Expand Down

0 comments on commit 84bd122

Please sign in to comment.