update cookies
This commit is contained in:
2
main.go
2
main.go
@@ -264,6 +264,8 @@ func main() {
|
|||||||
Name: "cartid",
|
Name: "cartid",
|
||||||
Value: "",
|
Value: "",
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
Secure: true,
|
||||||
|
HttpOnly: true,
|
||||||
Expires: time.Unix(0, 0),
|
Expires: time.Unix(0, 0),
|
||||||
SameSite: http.SameSiteLaxMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -274,6 +274,7 @@ func CookieCartIdHandler(fn func(w http.ResponseWriter, r *http.Request, cartId
|
|||||||
http.SetCookie(w, &http.Cookie{
|
http.SetCookie(w, &http.Cookie{
|
||||||
Name: "cartid",
|
Name: "cartid",
|
||||||
Value: cartId.String(),
|
Value: cartId.String(),
|
||||||
|
Secure: true,
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
Expires: time.Now().AddDate(0, 0, 14),
|
Expires: time.Now().AddDate(0, 0, 14),
|
||||||
@@ -292,6 +293,8 @@ func (s *PoolServer) RemoveCartCookie(w http.ResponseWriter, r *http.Request, ca
|
|||||||
Name: "cartid",
|
Name: "cartid",
|
||||||
Value: cartId.String(),
|
Value: cartId.String(),
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
Secure: true,
|
||||||
|
HttpOnly: true,
|
||||||
Expires: time.Unix(0, 0),
|
Expires: time.Unix(0, 0),
|
||||||
SameSite: http.SameSiteLaxMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user