[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [Help](/c/help/9) # astroJS action to destory cookie doesn't work on vercel 52 views · 3 likes · 3 posts Grahf0085 (@grahf0085) · 2024-07-20 I'm using a astroJS action to destroy a cookie when someone logs out. Works on local host and looks like this: ``` logoutUser: defineAction({ handler: (_, context) => { const TOKEN = import.meta.env.TOKEN try { context.cookies.set(TOKEN, '', { httpOnly: true, maxAge: 0, path: '/', secure: true, sameSite: 'lax', }) return true } catch (error) { console.error('Error logging out: ', error) throw new Error(error.message || error) } }, }), ``` When I click the button to logout on my app deployed with vercel I get: > 17:03:11 [ERROR] SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19) at successSteps (node:internal/deps/undici/undici:5555:27) at fullyReadBody (node:internal/deps/undici/undici:1665:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async specConsumeBody (node:internal/deps/undici/undici:5564:7) at async Module.POST (file:///var/task/vercel/path0/.vercel/output/_functions/chunks/route_Yu3iUWSv.mjs:17:12) at async renderEndpoint (file:///var/task/vercel/path0/.vercel/output/_functions/chunks/astro/server_CBvJsTK-.mjs:45:20) at async lastNext (file:///var/task/vercel/path0/.vercel/output/_functions/entry.mjs:1031:23) at async callMiddleware (file:///var/task/vercel/path0/.vercel/output/_functions/entry.mjs:480:10) Grahf0085 (@grahf0085) · 2024-07-20 · ♥ 2 If anyone else has this problem it's fixed by changing const { data, error } = await actions.logoutUser.safe() to const { data, error } = await actions.logoutUser.safe({}) Pauline P. Narvas (@pawlean) · 2024-07-20 · ♥ 1 Thank you for coming back here with the solution, @grahf0085! Hoping to continue seeing you around the community :rocket: