Back

Logins have an expire date set for yesterday?

  • 0
  • Users
  • Web
Rui Sousa
19 Oct, 2023, 07:40

This has happened to me with NextJS and SvelteKit. I'm following the code from https://appwrite.io/docs/quick-starts/nextjs and what I see in the user's session, is that the expire parameter is set to yesterday while on Appwrite I have the session length of the 365 days

What is happening here?

TL;DR
The user is experiencing an issue with logins expiring before they should. They mention trying SSR techniques with Appwrite and moving functions to a .page file to solve the issue. They also ask if there is a way to use Svelte's form actions to send the cookie to be stored on the client side. The user wonders if timezones could be affecting the timestamp. They confirm that the login cookie is not present in the browser's cookie storage. Another user points out that the issue is with the cookie not being kept on hard reload. The user clarifies that the issue is with the expire date set to yesterday instead of the specified
Drake
19 Oct, 2023, 12:51

What do you mean yesterday? The year is 2024

Rui Sousa
19 Oct, 2023, 14:12

Oh, you're right 🤦‍♂️ In that case, why is it that on hard reload the cookie isn't kept?

Drake
19 Oct, 2023, 14:44

what makes you say that?

Rui Sousa
19 Oct, 2023, 15:38

checking the cookies storage on the browser and seeing that the cookie for the login is not longer there

Drake
19 Oct, 2023, 18:42

can you share a screenshot of what you're seeing?

VincentGe
19 Oct, 2023, 18:46

I also wonder if timezones make a difference, take the timestamp and convert it to your local timezone?

Rui Sousa
19 Oct, 2023, 19:04

Ok, so I had the functions on the .server file and that was the issue. Moving them to .page made them work. Wondering if there would be a way of still using Svelte’s form actions and send the cookie via the result to store it on the client side

Drake
19 Oct, 2023, 19:06

you may need to look into Appwrite SSR techniques. For example, you can look at https://svelte-kit.ssr.almostapps.eu/

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more