How do I make a session timeout after X minutes of inactivity. All I seem to see is Fixed anount of minutes in the examples. Thanks for any help.

Comment From: athurg

If you use github.com/gin-gonic/contrib/sessions/sessions as your session middleware, you can just set the timeout as below: sessions.Default(c).Options(sessions.Option{MaxAge: nSeconds})`

Just replace nSeconds with a int value.

Comment From: LeiYangGH

If you use github.com/gin-gonic/contrib/sessions/sessions as your session middleware, you can just set the timeout as below: sessions.Default(c).Options(sessions.Option{MaxAge: nSeconds})`

Just replace nSeconds with a int value.

sessions.Option <--- missing s?

Comment From: J2cx

i have to reset expiration time for cookie and redis for every activity, because the gin-session option maxage only works when the session creation. I can't understand why gin-session don't provide an option for expiration. I can't think this is a good desgin.