Skip to content

Commit

Permalink
Configurable session age in sql connector
Browse files Browse the repository at this point in the history
  • Loading branch information
markdicksonjr committed Dec 28, 2018
1 parent b4ee5be commit c55fee1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion session/connectors/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type SqlMemoryStoreConnector struct {
SqlExtension *sql.Extension
Secret string
MaxAgeMs int

connectionInfo string
db *gorm.DB
Expand Down Expand Up @@ -46,5 +47,8 @@ func (s SqlMemoryStoreConnector) Connect() (error, sessions.Store) {
}

func (s SqlMemoryStoreConnector) MaxAge() int {
return 60 * 60 * 24 * 15 // 15 days
if s.MaxAgeMs == 0 {
return 60 * 60 * 24 * 15 // 15 days
}
return s.MaxAgeMs
}

0 comments on commit c55fee1

Please sign in to comment.