From c55fee1a35f535d0ed64448d6b193881fd52a8cd Mon Sep 17 00:00:00 2001 From: Mark Dickson Jr Date: Fri, 28 Dec 2018 09:23:08 -0500 Subject: [PATCH] Configurable session age in sql connector --- session/connectors/sql.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/session/connectors/sql.go b/session/connectors/sql.go index a667418..4132185 100644 --- a/session/connectors/sql.go +++ b/session/connectors/sql.go @@ -11,6 +11,7 @@ import ( type SqlMemoryStoreConnector struct { SqlExtension *sql.Extension Secret string + MaxAgeMs int connectionInfo string db *gorm.DB @@ -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 }