Home / Function/ Test_Ctx_ClearCookie() — fiber Function Reference

Test_Ctx_ClearCookie() — fiber Function Reference

Architecture documentation for the Test_Ctx_ClearCookie() function in ctx_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  4cca3ff7_fab3_0f09_a6bb_dfd3b907ffa4["Test_Ctx_ClearCookie()"]
  7b3d4933_5ae3_f84d_ff6d_0cb34e268026["ctx_test.go"]
  4cca3ff7_fab3_0f09_a6bb_dfd3b907ffa4 -->|defined in| 7b3d4933_5ae3_f84d_ff6d_0cb34e268026
  style 4cca3ff7_fab3_0f09_a6bb_dfd3b907ffa4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

ctx_test.go lines 5068–5082

func Test_Ctx_ClearCookie(t *testing.T) {
	t.Parallel()
	app := New()
	c := app.AcquireCtx(&fasthttp.RequestCtx{})

	c.Request().Header.Set(HeaderCookie, "john=doe")
	c.Res().ClearCookie("john")
	require.True(t, strings.HasPrefix(string(c.Response().Header.Peek(HeaderSetCookie)), "john=; expires="))

	c.Request().Header.Set(HeaderCookie, "test1=dummy")
	c.Request().Header.Set(HeaderCookie, "test2=dummy")
	c.ClearCookie()
	require.Contains(t, string(c.Response().Header.Peek(HeaderSetCookie)), "test1=; expires=")
	require.Contains(t, string(c.Response().Header.Peek(HeaderSetCookie)), "test2=; expires=")
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Ctx_ClearCookie() do?
Test_Ctx_ClearCookie() is a function in the fiber codebase, defined in ctx_test.go.
Where is Test_Ctx_ClearCookie() defined?
Test_Ctx_ClearCookie() is defined in ctx_test.go at line 5068.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free