mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
Update to 8.2.1 | LevelDB-based session database implemented, Read HISTORY.md
Former-commit-id: 4e341b185aedaaa9a04fdebe43b4364dec59e3c8
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris"
|
||||
"github.com/kataras/iris/context"
|
||||
|
||||
@@ -21,12 +23,14 @@ func main() {
|
||||
IdleTimeout: service.DefaultRedisIdleTimeout,
|
||||
Prefix: ""}) // optionally configure the bridge between your redis server
|
||||
|
||||
// use go routines to query the database
|
||||
db.Async(true)
|
||||
// close connection when control+C/cmd+C
|
||||
iris.RegisterOnInterrupt(func() {
|
||||
db.Close()
|
||||
})
|
||||
|
||||
sess := sessions.New(sessions.Config{Cookie: "sessionscookieid"})
|
||||
sess := sessions.New(sessions.Config{Cookie: "sessionscookieid", Expires: 45 * time.Minute})
|
||||
|
||||
//
|
||||
// IMPORTANT:
|
||||
|
||||
Reference in New Issue
Block a user