I know how to use gorilla under golang to manage sessions. But what I'm trying to accomplish is to optionally set the session expiry time to a later date at run time, depending upon various application conditions. I haven't been able to figure out how to update this expiry time.
Consider the following code fragment ...
skey := "some sort of secret key"
sname := "some sort of session name"
session_store := sessions.NewCookieStore([]byte(skey))
session_store.Options = &sessions.Options{
MaxAge: 300,
}
// `r` is previously defined as the current *http.Request
sess, err := session_store.Get(r, sname)
As written, sess
will expire 300 seconds after it was initialized. But how can I extend the lifetime of sess
before this much time passes, so that its expiry will then occur at a later time?
Thank you in advance.