server icon indicating copy to clipboard operation
server copied to clipboard

Cookie error

Open bfcns opened this issue 1 year ago • 5 comments

{"application":"Desktop-3.195.13","level":"error","message":"No cookies provided for cookie-based session token.","method":"POST","service":"auth:server","sessionUuid":"a6048f6e-63aa-42bc-a9a4-153654435e5e","snjs":"2.209.5","url":"/v1/items","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) StandardNotes/3.195.13 Chrome/126.0.6478.114 Electron/31.1.0 Safari/537.36","userId":"708c45ca-e15e-4003-90aa-3ca704f8aad8"}
query: SELECT `revoked_session`.`uuid` AS `revoked_session_uuid`, `revoked_session`.`private_identifier` AS `revoked_session_private_identifier`, `revoked_session`.`user_uuid` AS `revoked_session_user_uuid`, `revoked_session`.`received` AS `revoked_session_received`, `revoked_session`.`created_at` AS `revoked_session_created_at`, `revoked_session`.`received_at` AS `revoked_session_received_at`, `revoked_session`.`user_agent` AS `revoked_session_user_agent`, `revoked_session`.`api_version` AS `revoked_session_api_version` FROM `revoked_sessions` `revoked_session` WHERE `revoked_session`.`private_identifier` = ? -- PARAMETERS: ["52567c859869cd04807485472c943596"]

having the same error.

Using a proxmox alpine lxc as self-hosted.

Using windows desktop app to connect. Version 3.195.13

Originally posted by @bfcns in https://github.com/standardnotes/server/issues/1064#issuecomment-2511886691

bfcns avatar Dec 02 '24 15:12 bfcns

Installed it via VM same error

bfcns avatar Dec 14 '24 14:12 bfcns

Getting the same error on a Desktop app Version 3.195.15 (3.195.15) after installing via Docker Compose. Basically, the Desktop app is unusable because of this, as it asks you to log in over and over.

It works fine using the latest iOS client though.

pavel-d avatar Jan 17 '25 14:01 pavel-d

Same Error, Linux App 3.195.13-1 selfhosted, newest Version. It is really sad, no one cares since december. Did anyone resolve this?

dasTor avatar Feb 06 '25 15:02 dasTor

I was just dealing with the same issue. There is unfortunately an important configuration option missing in the documentation. You need to set

COOKIE_DOMAIN=<your-API-hostname>

in the .env file. I finally figured this out when I switched to the Console tab of the browser developer tools, where I found the following error messages:

Cookie <cookie_name> rejected for invalid domain

Then, in the /login request in the Network tab I found that the cookies were being set for the default domain, "standardnotes.com". When I searched for this error message, I found this Reddit post with a solution.

This is quite strange as it should be fairly easy to auto-detect the correct domain within the API request... I'll see if I can at least get the documentation updated.

piit79 avatar Feb 07 '25 08:02 piit79

Thx @piit79. I made another update with docker compose down / pull / up -d, edited .env and docker-compose.yml (as the reddit guy did) and now it's running again.

dasTor avatar Feb 07 '25 09:02 dasTor