Skip to content

Commit 9cc299a

Browse files
committed
docfix/Adding notes and debug settings to help diagnose session storage problems which can cause issues with login
1 parent 779812a commit 9cc299a

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ VITE_CHATBOT_URL=http://localhost:5000
3636
# https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production
3737
# The value could be: development, staging, production
3838
# NODE_ENV=development
39+
40+
# If you have a problem with session storage (which will cause problems with login) you can enable this. See README for further info.
41+
#DEBUG=express-session

Dockerfiles/prestart.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
)
1111

1212
func main() {
13+
// Define the host env variables to be replaced at build time
1314
config := []string{"VITE_OBP_API_HOST", "VITE_OBP_API_MANAGER_HOST", "VITE_OBP_API_PORTAL_HOST"}
1415
configMap := make(map[string]string)
1516

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,37 @@ server {
112112
}
113113
```
114114

115+
Note: if you have issues with session stickyness / login issues, enable #DEBUG=express-session in your .env
116+
and if you see messages like these in the log,
117+
118+
```
119+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session no SID sent, generating session
120+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session saving 5JIW_dx9CG8qs0OK4iv7Pn2Kg2huZuvQ
121+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session not secured
122+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session split response
123+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session saving -yf0uzAZf5mP9JVYov9oMR7CxQLnO4wm
124+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session not secured
125+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session no SID sent, generating session
126+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session saving nballQYMYZRn_HG0enM2RIPdv7GAdzJc
127+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session not secured
128+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session no SID sent, generating session
129+
Dec 10 12:26:18 obp-sandbox node[1060160]: Tue, 10 Dec 2024 12:26:18 GMT express-session no SID sent, generating session
130+
131+
```
132+
133+
then make sure your NGINX config includes the $scheme:
134+
135+
```
136+
137+
proxy_set_header X-Real-IP $remote_addr;
138+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
139+
proxy_set_header X-Forwarded-Proto $scheme;
140+
141+
```
142+
143+
so that Node knows that the cookies have been sent securely over https.
144+
145+
115146
# LICENSE
116147

117148
This project is licensed under the AGPL V3 (see NOTICE) and a commercial license from TESOBE.

0 commit comments

Comments
 (0)