Session should expire after an hour of inactivity
This commit is contained in:
parent
29d666d84e
commit
d6555d9f90
1 changed files with 10 additions and 1 deletions
|
|
@ -27,9 +27,18 @@ func GetSessionStore(c *fiber.Ctx) (*session.Session, error) {
|
|||
|
||||
store = session.New(session.Config{
|
||||
Storage: storage,
|
||||
Expiration: time.Hour,
|
||||
})
|
||||
storeCreated = true
|
||||
}
|
||||
|
||||
session, err := store.Get(c)
|
||||
if err != nil {
|
||||
return session, err
|
||||
}
|
||||
|
||||
session.Set("test", time.Now())
|
||||
session.Save()
|
||||
|
||||
return store.Get(c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue