1

using the following code to set a cookie in my expressJS backend.

Edit The package I am using is 'cookie-session'. https://www.npmjs.com/package/cookie-session I should have specified this my bad. But no setting maxAge to null did not work. The cookie is still there when I reopen the browser.

app.use(
cookieSession({
    
    secret: 'secretmonkey',
    secure: false,
    maxAge: null,
    }),
);

I read that if maxAge is set to null the cookie should be deleted automatically when browser is closed.

What happens (using chrome) is that the cookie persists.

Karim Kamel
  • 75
  • 1
  • 8

1 Answers1

0

so it turns out I had Chrome open in another desktop on my operating system. So when I was closing the browser it only counted as closing the tab. Chrome was still running after all in the other desktop. Sorry for the silly question, my bad.

Karim Kamel
  • 75
  • 1
  • 8