1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-27 14:57:05 +00:00
Former-commit-id: 4324e81ea94ef917ce39005b6038a6819bb63258
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-08-14 16:29:04 +03:00
parent 20c0bbe9ba
commit f6436f2af4
11 changed files with 191 additions and 36 deletions

View File

@@ -55,6 +55,12 @@ func (db *Database) Acquire(sid string, expires time.Duration) sessions.LifeTime
return sessions.LifeTime{Time: time.Now().Add(time.Duration(seconds) * time.Second)}
}
// OnUpdateExpiration will re-set the database's session's entry ttl.
// https://redis.io/commands/expire#refreshing-expires
func (db *Database) OnUpdateExpiration(sid string, newExpires time.Duration) error {
return db.redis.UpdateTTLMany(sid, int64(newExpires.Seconds()))
}
const delim = "_"
func makeKey(sid, key string) string {