Open oddstr13 opened 2 years ago
I had ended up with multiple session cookies, with different path on them (7 in total, for different pages within the app). Deleting all of them and logging back in gave me a working session.
Looks like the additional cookies are set in response to POST requests.
Deleting only the one on the root path (/
), and then logging back in (getting a new session cookie on the root path, but not on /wishlist
etc) causes a redirect loop back via /login
-> /
-> /wishlist
-> /login
.
/
and /login
are presented with one sid, but /wishlist
by two different cookies with the same name.
I think it's possible to hit this error condition without manually deleting the cookie too (possibly due to session expiry?), as I've seen that redirect loop behavior before, and the workaround has been to delete all domain cookies.
I have not managed to reproduce the stack trace, but I think it may be related to this behavior in regards to cookies.
I have had this happen to me before, but could never make it happen consistently so I wasn't able to experiment with fixes.
There's a relevant issue in expressjs: https://github.com/expressjs/session/issues/551
I have the problem when i reset the activation password link, send to the person, and getting "Internal Server Error". Hope it helps :)
Is anything logged in the console?
Possibly an upstream issue, as I don't see files from this project in the stack trace?
Version: 1.27.1 (9e6149c57e6f1f44cedd6545215de048ff2a302c) + a tiny hack to get my modifications to get-product-name included (see bottom of the issue)
Possibly related to the following stacktrace from a day earlier;
[expand] My local changes for running custom get-product-name
```diff diff --git a/Dockerfile b/Dockerfile index e114ef1..6fc0667 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,20 @@ RUN apk --no-cache add curl ENV NODE_ENV production WORKDIR /usr/src/app -COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "patched-express-response.js", "./"] -RUN npm install --production --silent +COPY ["package.json", "npm-shrinkwrap.json*", "patched-express-response.js", "./"] +COPY ./get-product-name ./get-product-name + +#RUN yarn install --force +#RUN pushd get-product-name; yarn install --force; popd + + +RUN cd get-product-name && npm install --production; cd .. +RUN npm install --production +RUN npm install session-pouchdb-store +RUN npm install passport-local +RUN npm install bcrypt-nodejs +RUN npm install connect-flash +RUN npm install passport COPY . . @@ -19,4 +31,4 @@ ENV DB_PREFIX /data/dbs/ ENV SECRET_DIRNAME /data -CMD ./Dockerstart.sh \ No newline at end of file +CMD ./Dockerstart.sh diff --git a/package.json b/package.json index e4bf0e0..57de08d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "express": "4.17.1", "express-pouchdb": "^4.2.0", "express-session": "^1.17.2", - "get-product-name": "1", + "get-product-name": "file:./get-product-name", "jsdom": "^17.0.0", "lodash": "^4.17.20", "marked": "^3.0.3", ```