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
I test this frame , and found that the session can not refresh itself , which multple visit in 30 minutes , and the session can not renewal automatic.
How to resolve this problem ? thx
The text was updated successfully, but these errors were encountered:
I hope someone answer to this issue cause I didn't find a solution on the web , I tried to implement the refresh on the middleware but way.
Sorry, something went wrong.
I tried a lot of tests, but the only one that works for me is to implement in the middleware a reset to the payload on the session and save it again .
Alright here is the the example of the middleware :
func CheckAuthMiddleware() gin.HandlerFunc { return func(c *gin.Context) { session := sessions.Default(c) userId := session.Get("id") phoneNum := session.Get("phone_number") if userId == nil || phoneNum == nil { c.Abort() c.Redirect(http.StatusMovedPermanently, "/auth/login") return } session.Set("id", userId) session.Save() c.Next() } }
I don't know if there is a better solution but this is the one that works . Thank you
you can refer to my project. link
No branches or pull requests
I test this frame , and found that the session can not refresh itself , which multple visit in 30 minutes , and the session can not renewal automatic.
How to resolve this problem ? thx
The text was updated successfully, but these errors were encountered: