summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-08 11:29:11 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-08 11:29:11 -0500
commit53ee703e7ccce13d745351f3c343a47d0e927db5 (patch)
treeed307cbf00eac091434748a8948a064b1b7296a5 /api/user.go
parent96cb7345dafbf07027acb9dc05fc7d0808a4ac38 (diff)
downloadchat-53ee703e7ccce13d745351f3c343a47d0e927db5.tar.gz
chat-53ee703e7ccce13d745351f3c343a47d0e927db5.tar.bz2
chat-53ee703e7ccce13d745351f3c343a47d0e927db5.zip
Add ExpiresAt to session cookie so that IE/Edge store the cookie
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go3
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,
}