Add ExpiresAt to session cookie so that IE/Edge store the cookie
Этот коммит содержится в:
@@ -31,6 +31,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitUser(r *mux.Router) {
|
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)
|
multiToken = strings.TrimSpace(multiToken + " " + session.Token)
|
||||||
|
expiresAt := time.Unix(model.GetMillis()/1000+int64(maxAge), 0)
|
||||||
|
|
||||||
multiSessionCookie := &http.Cookie{
|
multiSessionCookie := &http.Cookie{
|
||||||
Name: model.SESSION_COOKIE_TOKEN,
|
Name: model.SESSION_COOKIE_TOKEN,
|
||||||
Value: multiToken,
|
Value: multiToken,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
MaxAge: maxAge,
|
MaxAge: maxAge,
|
||||||
|
Expires: expiresAt,
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user