mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
remove MaxAgeSeconds from redis sessiondb - now it derives from the sessions configuration automatically. Add option to use an existing BoltDB connection on boltdb sessiondb.
TODO: leveldb sessiondb Former-commit-id: 8cb781bf089ab7b9a09dccc633454db9c6077610
This commit is contained in:
@@ -11,15 +11,20 @@ import (
|
||||
|
||||
func main() {
|
||||
// replace with your running redis' server settings:
|
||||
db := redis.New(service.Config{Network: service.DefaultRedisNetwork,
|
||||
Addr: service.DefaultRedisAddr,
|
||||
Password: "",
|
||||
Database: "",
|
||||
MaxIdle: 0,
|
||||
MaxActive: 0,
|
||||
IdleTimeout: service.DefaultRedisIdleTimeout,
|
||||
Prefix: "",
|
||||
MaxAgeSeconds: service.DefaultRedisMaxAgeSeconds}) // optionally configure the bridge between your redis server
|
||||
db := redis.New(service.Config{
|
||||
Network: service.DefaultRedisNetwork,
|
||||
Addr: service.DefaultRedisAddr,
|
||||
Password: "",
|
||||
Database: "",
|
||||
MaxIdle: 0,
|
||||
MaxActive: 0,
|
||||
IdleTimeout: service.DefaultRedisIdleTimeout,
|
||||
Prefix: ""}) // optionally configure the bridge between your redis server
|
||||
|
||||
// close connection when control+C/cmd+C
|
||||
iris.RegisterOnInterrupt(func() {
|
||||
db.Close()
|
||||
})
|
||||
|
||||
sess := sessions.New(sessions.Config{Cookie: "sessionscookieid"})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user