Back

[SOLVED] Cookie (login)

  • 0
  • Self Hosted
  • Accounts
  • Web
Nik
29 Oct, 2023, 14:52

Please tell me what am I doing wrong? When I log into the application, I receive a cookie without the secure flag, samesite: none, which is why a backup one is set. Nextjs website on the app.ru domain, appwrite on the appwrite.app.ru domain, https everywhere. (SDK Web)

TL;DR
The user had an issue with a cookie (login) and received helpful responses from other users. The issue was resolved by changing the configuration due to an NPM issue. The user also asked about two cookies arriving and it was confirmed that this was normal. It was recommended to ensure forwarding to the https port and to use SSL certificates. The user mentioned self-hosting and using nginx proxy manager. The user asked for clarification on traffic from NPM to Appwrite and it was confirmed that it is https. The user also asked about any mistakes they might be making regarding receiving a cookie without the secure flag. The website is built using Nextjs
Drake
29 Oct, 2023, 15:21

Backup what? Are you on appwrite cloud?

Nik
29 Oct, 2023, 15:29

appwrite hosting

Drake
29 Oct, 2023, 15:37

You're self hosting? Do you have anything in front of Appwrite like a reverse proxy?

Nik
29 Oct, 2023, 15:39

Self-hosting, I use nginx proxy manager to redirect from server:3000 to the https domain

Drake
29 Oct, 2023, 15:40

Ummm is traffic from NPM to Appwrite https?

Nik
29 Oct, 2023, 15:49

That's right, SSL certificates are installed everywhere

Drake
29 Oct, 2023, 15:51

Soo Appwrite's https port is 3000?

Nik
29 Oct, 2023, 15:57

appwrite on port 3000, if you go through server ip: 3000, then there is http.

Drake
29 Oct, 2023, 15:58

Please make sure you're forwarding to the https port

Nik
29 Oct, 2023, 16:00

Okay, thanks, I'll check it out. I'll try to start everything again now.

Nik
31 Oct, 2023, 06:21

Good afternoon, you were right, it was an NPM issue, I changed the configuration and now there is a secure flag. Please also tell me why 2 cookies arrive, is this how it should be?

otik
31 Oct, 2023, 14:09

Yes this is correct. Legacy cookie is for legacy reasons. You can ignore it

Nik
31 Oct, 2023, 16:50

Thank you!

Drake
31 Oct, 2023, 20:34
Drake
31 Oct, 2023, 20:34

[SOLVED] Cookie (login)

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