Gin: Session timeout

Created on 8 Jul 2016  路  2Comments  路  Source: gin-gonic/gin

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.

question

Most helpful comment

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.

All 2 comments

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 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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gplume picture gplume  路  3Comments

sofish picture sofish  路  3Comments

iiinsomnia picture iiinsomnia  路  3Comments

lilee picture lilee  路  3Comments

ghost picture ghost  路  3Comments