We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`s := gin.New() s.Use(gin.Recovery()) s.Use(gin.Logger()) store, _ := sessions.NewRedisStore(10, "tcp", "192.168.99.100:32775", "", []byte("secret")) store.Options(sessions.Options{ MaxAge: 3600, Path: "/", Secure: true, HttpOnly: true, }) s.Use(sessions.Sessions("session", store)) s.GET("/home",controllers.Home)
` controllers.Home
` func Home(c *gin.Context) {
s := sessions.Default(c) var count int v := s.Get("count") if v == nil { count = 0 } else { count = v.(int) count += 1 } s.Set("count", count) s.Save() c.JSON(200, gin.H{"count": count})
}`
/home return {"count":0} with no cookie
The text was updated successfully, but these errors were encountered:
yes it is not working
Sorry, something went wrong.
No branches or pull requests
`
controllers.Home
`
func Home(c *gin.Context) {
}`
/home return {"count":0} with no cookie
The text was updated successfully, but these errors were encountered: