[GH-ISSUE #854] Forwarding login cookie to Calibre Webserver #722

Closed
opened 2026-02-26 06:34:08 +03:00 by kerem · 9 comments
Owner

Originally created by @jebr on GitHub (Feb 1, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/854

Checklist

What is troubling you?
I am having problems sending a login cookie trough the proxy manager. I use the calibre-web application and it is automatically logged out after logging in. According to the developer, this has to do with the login cookie not being properly forwarded to the web server. I have performed the suggested actions but they are not having the desired effect. I have already tried ato pass extra values to the proxy manager, but nothing seems to work. When I access the web server locally, I do stay logged in.

Do you have any idea how I can fix this problem?

Originally created by @jebr on GitHub (Feb 1, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/854 **Checklist** - [x] Please read the [setup instructions](https://nginxproxymanager.com/setup/) - [x] Please read the [FAQ](https://nginxproxymanager.com/faq/) **What is troubling you?** I am having problems sending a login cookie trough the proxy manager. I use the [calibre-web](https://github.com/janeczku/calibre-web) application and it is automatically logged out after logging in. According to the developer, this has to do with the login cookie not being properly forwarded to the web server. I have performed the suggested actions but they are not having the desired effect. I have already tried ato pass extra values to the proxy manager, but [nothing ](https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy) seems to work. When I access the web server locally, I do stay logged in. Do you have any idea how I can fix this problem?
kerem 2026-02-26 06:34:08 +03:00
Author
Owner

@petkin700 commented on GitHub (Feb 1, 2021):

Is your cookie set for correct domain which is terminated on npm?

<!-- gh-comment-id:771140140 --> @petkin700 commented on GitHub (Feb 1, 2021): Is your cookie set for correct domain which is terminated on npm?
Author
Owner

@jebr commented on GitHub (Feb 1, 2021):

Thanks for your quick response. As I can see now it seems that the right domain is associated with the cookie. I have added an image of the data from my browser.

cookie

<!-- gh-comment-id:771144429 --> @jebr commented on GitHub (Feb 1, 2021): Thanks for your quick response. As I can see now it seems that the right domain is associated with the cookie. I have added an image of the data from my browser. ![cookie](https://user-images.githubusercontent.com/7726815/106515570-2adf7a80-64d6-11eb-9782-405bbec27c0f.png)
Author
Owner

@petkin700 commented on GitHub (Feb 2, 2021):

Hi jebr,

today I bring up the calibre-web from this docker image in my home lab and could not reproduce your issue with authentication when it resides behind npm

Screen Shot 2021-02-02 at 1 45 19 PM
<!-- gh-comment-id:771581736 --> @petkin700 commented on GitHub (Feb 2, 2021): Hi jebr, today I bring up the calibre-web from this [docker image](https://hub.docker.com/r/linuxserver/calibre-web) in my home lab and could not reproduce your issue with authentication when it resides behind npm <img width="1477" alt="Screen Shot 2021-02-02 at 1 45 19 PM" src="https://user-images.githubusercontent.com/30834618/106596211-5c4f5900-655d-11eb-84b8-d66bb54fa146.png">
Author
Owner

@jebr commented on GitHub (Feb 2, 2021):

Thank you very much for testing calibre-web. After your message I checked what kind of traffic is still running between npm and the application.
In the browser I get the following message:
Cookie “remember_token” has been rejected because it is already expired.

I am using Cloudflare (proxy) -> npm -> calibre-web. I have now set the connection to DNS-only in Cloudflare and that seems to solve the problem, I am no longer logged out.

The strange thing is that I use multiple applications behind npm that continue to work when Cloudflare is on proxy. Do you know if I can keep Cloudflare on DNS-only without any problems?
cloudflare_settings

<!-- gh-comment-id:771617811 --> @jebr commented on GitHub (Feb 2, 2021): Thank you very much for testing calibre-web. After your message I checked what kind of traffic is still running between npm and the application. In the browser I get the following message: Cookie “remember_token” has been rejected because it is already expired. I am using Cloudflare (proxy) -> npm -> calibre-web. I have now set the connection to DNS-only in Cloudflare and that seems to solve the problem, I am no longer logged out. The strange thing is that I use multiple applications behind npm that continue to work when Cloudflare is on proxy. Do you know if I can keep Cloudflare on DNS-only without any problems? ![cloudflare_settings](https://user-images.githubusercontent.com/7726815/106603636-d502e500-655e-11eb-853e-086151002797.png)
Author
Owner

@petkin700 commented on GitHub (Feb 2, 2021):

you could use DNS only, but it's make really a small of sense, because:

  1. you expose your real IPs to the world
  2. you loose most benefits of cloudflare protection

tomorrow i'll try to reproduce your setup with my cloudflare account and already deployed calibre-web )))

<!-- gh-comment-id:771891873 --> @petkin700 commented on GitHub (Feb 2, 2021): you could use DNS only, but it's make really a small of sense, because: 1. you expose your real IPs to the world 2. you loose most benefits of cloudflare protection tomorrow i'll try to reproduce your setup with my cloudflare account and already deployed calibre-web )))
Author
Owner

@petkin700 commented on GitHub (Feb 2, 2021):

ok tomorrow is comes )))
I try to use cloudflare, and also couldn't reproduce your cookie problem, so i think it's cloudflare protection play with you and calibre, try to read cloudflare doc's and may be turn protection level not so hard for begining

<!-- gh-comment-id:771928993 --> @petkin700 commented on GitHub (Feb 2, 2021): ok tomorrow is comes ))) I try to use cloudflare, and also couldn't reproduce your cookie problem, so i think it's cloudflare protection play with you and calibre, try to read cloudflare doc's and may be turn protection level not so hard for begining
Author
Owner

@jebr commented on GitHub (Feb 2, 2021):

Thanks for the quick testing. Very strange that this occurs. I will remove the domain from Cloudflare and recreate it, maybe that will help.

<!-- gh-comment-id:771930598 --> @jebr commented on GitHub (Feb 2, 2021): Thanks for the quick testing. Very strange that this occurs. I will remove the domain from Cloudflare and recreate it, maybe that will help.
Author
Owner

@jebr commented on GitHub (Feb 3, 2021):

It was indeed Cloudflare. After deleting the account and waiting for a few hours, I re-added the accounts. Now the page works fine, but after a few minutes and some clicking back and forth I get logged out again. I will contact Cloudflare to find out what is causing this.

The problem is in the Samesite cookies, unfortunately I have no idea what this means, I will read more about it.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
Cookie-SAM

<!-- gh-comment-id:772451836 --> @jebr commented on GitHub (Feb 3, 2021): It was indeed Cloudflare. After deleting the account and waiting for a few hours, I re-added the accounts. Now the page works fine, but after a few minutes and some clicking back and forth I get logged out again. I will contact Cloudflare to find out what is causing this. The problem is in the Samesite cookies, unfortunately I have no idea what this means, I will read more about it. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite ![Cookie-SAM](https://user-images.githubusercontent.com/7726815/106743322-83219400-661e-11eb-8239-732a7d701819.png)
Author
Owner

@jebr commented on GitHub (Feb 4, 2021):

You can close the issue from me. Unfortunately I am not getting it resolved for calibre-web. It has something to do with the forwarding and storage of cookie data (Samesite = ...). It also has something to do with the way calibre-web handles the login mechanism. This is the only container where I have problems logging in / staying logged in.

I want to thank you very much for your good support!

<!-- gh-comment-id:773570885 --> @jebr commented on GitHub (Feb 4, 2021): You can close the issue from me. Unfortunately I am not getting it resolved for calibre-web. It has something to do with the forwarding and storage of cookie data (Samesite = ...). It also has something to do with the way calibre-web handles the login mechanism. This is the only container where I have problems logging in / staying logged in. I want to thank you very much for your good support!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#722
No description provided.