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.
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.
If you use
github.com/gin-gonic/contrib/sessions/sessions asyour session middleware, you can just set the timeout as below:
sessions.Default(c).Options(sessions.Option{MaxAge:nSeconds})`Just replace
nSecondswith a int value.
sessions.Option <--- missing s?
Most helpful comment
If you use
github.com/gin-gonic/contrib/sessions/sessions asyour session middleware, you can just set the timeout as below:sessions.Default(c).Options(sessions.Option{MaxAge:nSeconds})`Just replace
nSecondswith a int value.