iris
iris copied to clipboard
Using redis to store session loss
My login session uses redis DB9 and the expiration time is set to 2 hours. When my application restarts or the page is refreshed in a random period, my login page is redirected because of session loss. In redis DB9, the data is empty, but the data in db1-db8 exists.
iris.Version
- e.g. v12.2.0-alpha
` sessManager := sessions.New(sessions.Config{ Cookie: "ph_qa", Expires: 2 * time.Hour, AllowReclaim: true, }) sessManager.UseDatabase(db)
common := mvc.New(app.Party("/"))
common.Router.Use(middleware.SingleUserAuth(sessManager, rc))
common.Register(
sessManager.Start,
services.CommonService{
CategoryClient: CourseCategoryClient,
SpocCategoryClient: SpocCategoryClient,
},
)
common.Handle(new(controllers.CommonController))`