Questions tagged [cookie-session]

Simple cookie-based session middleware for Express.js framework.

cookie-session is a simple cookie-based session middleware for Express.js framework.

94 questions
0
votes
2 answers

server sent cookie is not overriding the existing cookie

i have a express application and using cookie-session module for session management. application has 2 paths https://example.com/abc/def and https://example.com/abc/ghi . if i am visiting any path first then it sets a cookie but if i am changing the…
0
votes
1 answer

Generating unique sessionId with Express Cookie-Session

I'm using node/express.js with cookie-session's in my application and am trying to understand the proper way create a unique ID for each session. Currently, when a user logs in a cookie is stored in their browser with a value, for example: session:…
David Beaudway
  • 794
  • 10
  • 27
0
votes
1 answer

req.user returns undefined after authentication

I'm working on an express backend that uses passport-local and google-oauth2 strategies with cookie-session for authentication. The google-oauth strategy works great 100% with no issues. But my local-strategy returns req.user undefined... and…
Nico_R
  • 1
  • 1
0
votes
1 answer

Failed to serialize user into session with passportjs and cookie-session

I'm trying to get authentication with Google+ OAuth. To achieve this I'm using passportjs with Google strategy (passport-google-oauth20 module) but I'm stuck in an error while passport tries to serialize the user into a session (using…
0
votes
1 answer

Google OAuth 2.0 cannot login/logout in production

The login/logout functions work perfectly in development. However, after deploying it to heroku, the browser caches data and will stay logged in and the log out button just refreshes the page. I could clear browser cache data and it would allow me…
0
votes
1 answer

Log out all users with passport and cookie-session

I'm lazily changing my user schema (mongoose). My code will rewrite a user's data when a user logs in and is still using the old schema. To ensure no user is already logged in with the old schema when the new version gets deployed (which would…
ki9
  • 5,183
  • 5
  • 37
  • 48
0
votes
1 answer

Is it possible for a Javascript cookie to save to ALL apps / webviews / inappbrowsers, not a device?

So I have a phonegap app that accesses my webview, basically like window.load("URLTOMYAPPGOESHERE"); Inside the webview, once people login, I save cookies of userid. When the app is loaded, if the userid cookie exists already, it will show the…
0
votes
1 answer

cookie-session cannot set session

My question is about cookie-session. So I'm getting this problem after trying to deal with cookie-session. I cannot set any session. The problem is when im trying to set it req.session.login And this login is a problem but idk…
0
votes
0 answers

req.session is empty in POST route

I am using passport.js google oAuth20 along with cookie-session middleware, but whenever i console.log(req.session) it is {} (empty), it only happens in POST route Here is the route app.post("/addTodo", (req, res) => { console.log("POST",…
Mohhamad Hasham
  • 1,750
  • 1
  • 15
  • 18
0
votes
1 answer

passportjs google oauth2 strategy

In the PassportJS Google OAuth Strategy, for some strange reasons, when I serialize the user id and send it to the cookie to be sent to the browser, it does not return the id to deserialize it and that tells me because when I console.log user, it…
0
votes
1 answer

Cannot set Express session from inside callback

I know there's a few questions similar to this already, but they all have crucial differences which do not give me the solution. I'm using client-session module. I've set everything up exactly like it's specified in the docs, but for some reason I…
Konstantin
  • 1,150
  • 13
  • 31
0
votes
0 answers

How to stop saving cookies in expressjs cookie-session web app?

I want to dynamically set the option to save cookies or not using the cookie-session library. How to set the option to save session cookies or not?
Dinuka Salwathura
  • 924
  • 16
  • 33
0
votes
1 answer

Loopback session isn't saved

I added cookie-session to middleware.json I want to add id to session in login, and use it in function addLead "session": { "cookie-session": { "params": { "name": "id", "secret": "secret", "keys": [ "key1", "key2"…
user2136963
  • 2,526
  • 3
  • 22
  • 41
0
votes
1 answer

cookie-session doesn't save session modification

I wanted to remember the last page someone visited (like here) I tried to do it with cookie-session but It's doesn't work as I a suppose. I saw this and I tried this example for extending the session without success. Here the code : var session =…
Tittouns
  • 3
  • 3
0
votes
1 answer

cookie-session in Node.js not setting the session

This is giving me a huge headache, the CSRF cookie is working correctly but I've seemed to have broken something and cannot get the sessions to start. Any help would be appreciated. EDIT: I forgot to mention, I am using Nginx as a reverse proxy…