Skip to content

🐛 [Bug]: (c *fiber.Ctx).ClearCookie() does absolutely nothing #2878

@iacore

Description

@iacore

Bug Description

Setting the cookie is fine. The gofiber server responds with this header, which sets the cookie.

Set-Cookie: __Host-pixivfe-ImageProxy=https://i.pixiv.re; expires=Mon, 25 Mar 2024 15:06:10 GMT; path=/; HttpOnly; secure; SameSite=Strict

However, the server can't reset it.

Neither c.ClearCookie(name) or c.ClearCookie() work.

How to Reproduce

Steps to reproduce the behavior:

  1. Set the cookie above in browser
  2. have a server call c.ClearCookie
  3. See in Developer Tool > Storage > Cookies. cookie still there.

Expected Behavior

cookie cleared

Fiber Version

v2.52.0

Workaround

Set the cookie with no value and an expiration date in the past.

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions