const CUSTOM_COOKIE = 'x-custom-cookie';
export async function GET(request: NextRequest) {
response.cookies.set(CUSTOM_COOKIE, 'cookie_value', {
path: '/', // Cookie available on all paths
httpOnly: true, // Cannot be accessed via JavaScript
secure: true, // Only sent over HTTPS
maxAge: 60 * 120 // client-side cookie age (2 hours)
});
return response;
}
const CUSTOM_COOKIE = 'x-custom-cookie';
export async function GET(request: NextRequest) {
response.cookies.set(CUSTOM_COOKIE, 'cookie_value', {
path: '/', // Cookie available on all paths
httpOnly: true, // Cannot be accessed via JavaScript
secure: true, // Only sent over HTTPS
maxAge: 60 * 120 // client-side cookie age (2 hours)
});
return response;
}