signout from server in next js 13

can anyone tell me how can i signout from server in next auth? signOut() is not working and below code is also not working(i am using this inside server action
cookies().set({
name: "next-auth.csrf-token",
maxAge: 0,
value: "",
httpOnly: true,
sameSite: "lax",
priority: "medium",
domain: "/",
});
cookies().set({
name: "next-auth.callback-url",
maxAge: 0,
value: "",
sameSite: "lax",
priority: "medium",
httpOnly: true,
domain: "/",
});
cookies().set({
name: "next-auth.session-token",
maxAge: 0,
value: "",
sameSite: "lax",
priority: "medium",

httpOnly: true,

domain: "/",
});
cookies().set({
name: "next-auth.csrf-token",
maxAge: 0,
value: "",
httpOnly: true,
sameSite: "lax",
priority: "medium",
domain: "/",
});
cookies().set({
name: "next-auth.callback-url",
maxAge: 0,
value: "",
sameSite: "lax",
priority: "medium",
httpOnly: true,
domain: "/",
});
cookies().set({
name: "next-auth.session-token",
maxAge: 0,
value: "",
sameSite: "lax",
priority: "medium",

httpOnly: true,

domain: "/",
});
4 Replies
Grey
Grey17mo ago
set it's expiry to an old timestamp (as old as yesterday or older, like 1970-01-01) as well so it expires
Grey
Grey17mo ago
read the docs ^
pradeep
pradeepOP17mo ago
thank you it start working
Want results from more Discord servers?
Add your server