Skip to content
New issue

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃 How to automatically update session data expiration time ? #1917

Closed
ly020044 opened this issue May 27, 2022 · 0 comments 路 Fixed by #1960
Closed

馃 How to automatically update session data expiration time ? #1917

ly020044 opened this issue May 27, 2022 · 0 comments 路 Fixed by #1960

Comments

@ly020044
Copy link
Contributor

Question description
The expiration time of the data is updated when using session.Save, can the expiration time of the data be automatically updated when I visit any page ?

how about this plan

package main

import "github.com/gofiber/fiber/v2"

func main() {
  store := session.New()

  app := fiber.New()
  app.Use(func(ctx *fiber.Ctx) error {
                sess, _ := store.Get(ctx)
		if err := sess.Save(); err != nil {
			return err
		}

		return ctx.Next()
	})
  
  app.Get("/", func(ctx *fiber.Ctx) error {
    return ctx.SendString("index")  
  }  

 app.Listen(":3000")

}
@efectn efectn closed this as completed Jul 2, 2022
@ReneWerner87 ReneWerner87 linked a pull request Jul 2, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants