diff options
author | Corey Hulen <corey@hulen.com> | 2016-02-08 11:00:11 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-02-08 11:00:11 -0800 |
commit | cbee3e0a18f43a94fabf7c4c2692a7425de0354b (patch) | |
tree | ab2574ec39a80dfdd34f4423ed38c09426a2c52d | |
parent | 0d47dd0a0eb32e2364c68f706e6e9a463cb05953 (diff) | |
parent | 53ee703e7ccce13d745351f3c343a47d0e927db5 (diff) | |
download | chat-cbee3e0a18f43a94fabf7c4c2692a7425de0354b.tar.gz chat-cbee3e0a18f43a94fabf7c4c2692a7425de0354b.tar.bz2 chat-cbee3e0a18f43a94fabf7c4c2692a7425de0354b.zip |
Merge pull request #2102 from mattermost/plt-1697
PLT-1697 Add ExpiresAt to session cookie so that IE/Edge store the cookie
-rw-r--r-- | api/user.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/api/user.go b/api/user.go index 507c83d28..f814a93fe 100644 --- a/api/user.go +++ b/api/user.go @@ -31,6 +31,7 @@ import ( "net/url" "strconv" "strings" + "time" ) func InitUser(r *mux.Router) { @@ -633,12 +634,14 @@ func Login(c *Context, w http.ResponseWriter, r *http.Request, user *model.User, } multiToken = strings.TrimSpace(multiToken + " " + session.Token) + expiresAt := time.Unix(model.GetMillis()/1000+int64(maxAge), 0) multiSessionCookie := &http.Cookie{ Name: model.SESSION_COOKIE_TOKEN, Value: multiToken, Path: "/", MaxAge: maxAge, + Expires: expiresAt, HttpOnly: true, } |