diff options
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/api/user.go b/api/user.go index 507c83d28..8f381aeda 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, } @@ -793,7 +796,7 @@ func attachDeviceId(c *Context, w http.ResponseWriter, r *http.Request) { return } - w.Write([]byte(deviceId)) + w.Write([]byte(model.MapToJson(props))) } func RevokeSessionById(c *Context, sessionId string) { |