import { cookies } from 'next/headers' const LAST_PRODUCT_COOKIE = 'lastProductId' const THIRTY_DAYS_SECONDS = 60 * 60 * 24 * 30 export async function setLastProductCookie(productId: string) { const store = await cookies() store.set(LAST_PRODUCT_COOKIE, productId, { httpOnly: true, sameSite: 'lax', maxAge: THIRTY_DAYS_SECONDS, path: '/', }) } export async function getLastProductCookie(): Promise { const store = await cookies() return store.get(LAST_PRODUCT_COOKIE)?.value ?? null }