destroy() — astro Function Reference
Architecture documentation for the destroy() function in runtime.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 5c79ae32_65c5_f84c_14bd_7780a03d5e74["destroy()"] 91969197_292d_3b15_21c6_0e876968e961["AstroSession"] 5c79ae32_65c5_f84c_14bd_7780a03d5e74 -->|defined in| 91969197_292d_3b15_21c6_0e876968e961 8249bedb_c4c6_d6ed_cd7e_2f629ae41af9["storage()"] 8249bedb_c4c6_d6ed_cd7e_2f629ae41af9 -->|calls| 5c79ae32_65c5_f84c_14bd_7780a03d5e74 f7f62311_5ea1_d1da_6248_79ef0fe49f0e["get()"] 5c79ae32_65c5_f84c_14bd_7780a03d5e74 -->|calls| f7f62311_5ea1_d1da_6248_79ef0fe49f0e style 5c79ae32_65c5_f84c_14bd_7780a03d5e74 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/core/session/runtime.ts lines 215–225
destroy() {
// We don't use #ensureSessionID here because we don't want to create a new session ID if it doesn't exist.
const sessionId = this.#sessionID ?? this.#cookies.get(this.#cookieName)?.value;
if (sessionId) {
this.#toDestroy.add(sessionId);
}
this.#cookies.delete(this.#cookieName, this.#cookieConfig);
this.#sessionID = undefined;
this.#data = undefined;
this.#dirty = true;
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does destroy() do?
destroy() is a function in the astro codebase, defined in packages/astro/src/core/session/runtime.ts.
Where is destroy() defined?
destroy() is defined in packages/astro/src/core/session/runtime.ts at line 215.
What does destroy() call?
destroy() calls 1 function(s): get.
What calls destroy()?
destroy() is called by 1 function(s): storage.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free