mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 02:47:04 +00:00
need a better way to replace an existed cookie
Former-commit-id: bee4a686d50e61e607e7f86c1dee93a877cd1413
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user