Home / Function/ Test_Store_DeleteSession() — fiber Function Reference

Test_Store_DeleteSession() — fiber Function Reference

Architecture documentation for the Test_Store_DeleteSession() function in store_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  150fd6ae_afcf_db00_9433_7c97c2ee400d["Test_Store_DeleteSession()"]
  9bbf348a_f496_e909_6f62_6ea1938bfec4["store_test.go"]
  150fd6ae_afcf_db00_9433_7c97c2ee400d -->|defined in| 9bbf348a_f496_e909_6f62_6ea1938bfec4
  style 150fd6ae_afcf_db00_9433_7c97c2ee400d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/session/store_test.go lines 97–125

func Test_Store_DeleteSession(t *testing.T) {
	t.Parallel()
	// fiber instance
	app := fiber.New()
	// session store
	store := NewStore()

	// fiber context
	ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
	defer app.ReleaseCtx(ctx)

	// Create a new session
	session, err := store.Get(ctx)
	require.NoError(t, err)

	// Save the session ID
	sessionID := session.ID()

	// Delete the session
	err = store.Delete(ctx, sessionID)
	require.NoError(t, err)

	// Try to get the session again
	session, err = store.Get(ctx)
	require.NoError(t, err)

	// The session ID should be different now, because the old session was deleted
	require.NotEqual(t, sessionID, session.ID())
}

Subdomains

Frequently Asked Questions

What does Test_Store_DeleteSession() do?
Test_Store_DeleteSession() is a function in the fiber codebase, defined in middleware/session/store_test.go.
Where is Test_Store_DeleteSession() defined?
Test_Store_DeleteSession() is defined in middleware/session/store_test.go at line 97.

Analyze Your Own Codebase

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

Try Supermodel Free