Cookies not being generated except on localhost #471
-
I'm very new to Javascript/web development, so this may be an obvious issue. I've set up LibreChat and can access it both from a localhost address and from the public IPv4 address. When I login using the localhost address, a cookie is created and saved to the browser, such that when I refresh the page, I am still logged in. However, when I log in using the public IPv4 address, a cookie is not created, and so if I refresh the page, I am forced to log in again. Is there some setting I am missing in one of the two .env files or elsewhere? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
@itrase could be a couple things in your local environment. how are you accessing the address in your browser? are you using |
Beta Was this translation helpful? Give feedback.
-
got it working just used nginx ssl proxy to fwd to localhost
…On Fri, Jul 14, 2023 at 3:14 PM Danny Avila ***@***.***> wrote:
I haven't done this but my guess would be you need to edit
api/server/index.js
https://stackoverflow.com/questions/11744975/enabling-https-on-express-js
—
Reply to this email directly, view it on GitHub
<#471 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APSAFWNAC5EPRL7FYFUDDSTXQEZ3RANCNFSM6AAAAAAZBAGRCE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
what is your node env in the ec2 instance? The cookies are set to secure in a production environment and this is probably what's happening. See this for more info: https://stackoverflow.com/questions/73752871/aws-ec2-instance-does-not-set-cookie-when-sent-by-node-server-running-inside-it
You said you're using docker. the default NODE_ENV on the compose file is 'production'
edit this line in your docker-compose.yml file
- NODE_ENV=production
to- NODE_ENV=development