[BUG] ctx.RemoveCookie need more special attribute(domain
and path
) value to remove cookies
#2309
Labels
domain
and path
) value to remove cookies
#2309
Describe the bug
I can't say whether is a bug or by design. Maybe it by design, if it's by design I think some comment or tips need to point out at least.
ctx.RemoveCookie
is just remove cookie by name with no domain and path value.According the rfc 6265 -- 4.1.2 Semantics (Non-Normative) said:
so when I use this function to remove cookie, the domain value and the path value should the same as the user's local cookies.
I know that the
ctx.RemoveCookie
is support to passCookieOption
to set. But incase someone maybe encounter my case which I debug a long time to find the problemTo Reproduce
Steps to reproduce the behavior:
cd _examples/cookies/remove
go run main.go
http://localhost:8080/cookies/add/k/v
http://localhost:8080/cookies/remove/k
http://localhost:8080/cookies/remove/k
addressApplication
tab and find the cookies, you will see thek
cookie is not removedExpected behavior
Screenshots
Desktop (please complete the following information):
iris.Version
main
Please make sure the bug is reproducible over the
main
branch:Additional context
The except behavior's implement maybe a litter ugly(get cookies by name and then set the domain and path value as the cookies in request if it exist). but I think it should the right behavior.
If you think what I said is ok or a improvement to this API, I'm glad to make a pull request to do this :)
The text was updated successfully, but these errors were encountered: