Are you an LLM? You can read better optimized documentation at /api/@minimajs/cookie/functions/cookies.md for this page in Markdown format
Minima.js API / @minimajs/cookie / cookies
Function: cookies()
ts
function cookies<T>(): T;Retrieves all cookies from the current request as a typed record.
Type Parameters
T
T = Record<string, string>
Type definition for the cookie object (defaults to Record<string, string>)
Returns
T
All cookies as a typed record
Example
typescript
// Get all cookies (untyped)
const allCookies = cookies();
// Type: Record<string, string>
// Get all cookies with type safety
interface UserCookies {
sessionId?: string;
theme?: "light" | "dark";
}
const userCookies = cookies<UserCookies>();
// Type: UserCookiesSince
1.0.0