#Cookies not setting properly in Production

2 messages · Page 1 of 1 (latest)

brazen temple
#

Hi n.n, i have created this simple /auth/login route:
export async function GET(Request, Response) {
let {data} = await axios.request(reqOptions);
const {accessToken} = await data;
const response = NextResponse.json({message: "logged succesfully"});

response.cookies.set("access_token", accessToken, {
maxAge: 10800,
path: "/",
sameSite: "Strict",
});
return response;
}
It works perfect locally and when i deploy on Vercel also works great. But afther a while (like 3 hours) it just stops setting the cookies in the browser. I`m getting the access token from a backend hosted in HTTP (amazon).

Also mention that i have 2 pages with the line: export const dynamic = "force-dynamic";
Any idea?...

Next 13.4.4

chilly groveBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

      🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>

      ✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
      (if you don't see the option, try refreshing Discord with Ctrl + R)