Chore/Secure Cookies Env Variable#5281
Merged
Merged
Conversation
… explicit configuration of secure cookie settings.
erhhung
pushed a commit
to erhhung/flowise
that referenced
this pull request
Oct 5, 2025
Enhanced cookie security handling in the passport middleware to allow explicit configuration of secure cookie settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
When you set
APP_URLto an HTTPS value, Flowise automatically sets all authentication cookies (JWT tokens, refresh tokens, and session cookies) with thesecure: trueflag. This means cookies can only be transmitted over HTTPS connections. However, if your Flowise server is running behind a reverse proxy/load balancer that terminates SSL, or if there's any HTTP-to-HTTPS mismatch in your setup, the browser won't send these secure cookies, causing authentication to fail.The Fix
SECURE_COOKIESthat allows you to explicitly control cookie security settingsWhy This Happens
This is a common issue when running applications behind reverse proxies or load balancers:
APP_URLas HTTPS and sets secure cookiesSolution
The fix maintains backward compatibility - existing deployments without the
SECURE_COOKIESenvironment variable will continue to work as before.