MM-23935 extend session expiry on user activity (#14275)
* MM-23935 extend session expiry on user activity - if user types anything before a session expires the session will be extended to now + session length - ensures new session expiries are not written to DB too frequently - new session store func for updating session ExpiresAt - session length defaults for mobile and web/ldap changed from 180 days to 30 days
Этот коммит содержится в:
@@ -182,6 +182,14 @@ func (c *Context) MfaRequired() {
|
||||
}
|
||||
}
|
||||
|
||||
// ExtendSessionExpiryIfNeeded will update Session.ExpiresAt based on session lengths in config.
|
||||
// Session cookies will be resent to the client with updated max age.
|
||||
func (c *Context) ExtendSessionExpiryIfNeeded(w http.ResponseWriter, r *http.Request) {
|
||||
if ok := c.App.ExtendSessionExpiryIfNeeded(c.App.Session()); ok {
|
||||
c.App.AttachSessionCookies(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request) {
|
||||
subpath, _ := utils.GetSubpathFromConfig(c.App.Config())
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user