need a better way to replace an existed cookie

Former-commit-id: bee4a686d50e61e607e7f86c1dee93a877cd1413
This commit is contained in:
Wing Gao 2017-12-15 22:42:18 +08:00
parent 859a62bf01
commit c6b12ab754

View File

@ -53,6 +53,11 @@ func RemoveCookie(ctx context.Context, name string, purge bool) {
c.Value = "" c.Value = ""
c.Path = "/" c.Path = "/"
AddCookie(ctx, c, purge) AddCookie(ctx, c, purge)
if purge {
// delete request's cookie also, which is temporary available.
ctx.Request().Header.Set("Cookie", "")
}
} }
// IsValidCookieDomain returns true if the receiver is a valid domain to set // IsValidCookieDomain returns true if the receiver is a valid domain to set