summaryrefslogtreecommitdiffstats
path: root/app/login.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-05-04 16:36:31 -0400
committerGitHub <noreply@github.com>2017-05-04 16:36:31 -0400
commitfe95276ba849bc7a520087369eea0aaff6c92358 (patch)
tree7eaa8cca5fdd2ab7d2839e474fe3e34f468fc7a3 /app/login.go
parent1838f6c25eb95a34f7fc5892e6896b3c3e2f3673 (diff)
downloadchat-fe95276ba849bc7a520087369eea0aaff6c92358.tar.gz
chat-fe95276ba849bc7a520087369eea0aaff6c92358.tar.bz2
chat-fe95276ba849bc7a520087369eea0aaff6c92358.zip
PLT-6492 Use new cookie to determine if user is logged in (#6317)
* Use new cookie to determine if user is logged in * Add temporary code for 3.9 to prevent forced re-login
Diffstat (limited to 'app/login.go')
-rw-r--r--app/login.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/login.go b/app/login.go
index 4c7ab8474..4f9284140 100644
--- a/app/login.go
+++ b/app/login.go
@@ -122,7 +122,17 @@ func DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId
Secure: secure,
}
+ userCookie := &http.Cookie{
+ Name: model.SESSION_COOKIE_USER,
+ Value: user.Id,
+ Path: "/",
+ MaxAge: maxAge,
+ Expires: expiresAt,
+ Secure: secure,
+ }
+
http.SetCookie(w, sessionCookie)
+ http.SetCookie(w, userCookie)
return session, nil
}