Don't put session IDs in the HTML of a "signed-in devices" page.
Give each row a SHA-256 of its ID instead, and scope every revoke to the current user. The page can end sessions without knowing them.
33
connect-pg-simple's session table has no user column, so you can't just delete a user's sessions.
Reach into the JSON with sess->>'userId' and put an expression index on it. No custom store needed.
9
Changing your password doesn't sign out the library computer you forgot about.
The session never checks the password again after login. A new password only matters if you delete the session rows too.
youtu.be/cFHsiyIV6j4
4
saveUninitialized: false doesn't stop session fixation.
If your auth middleware writes req.session.returnTo before login, the session already exists. The user logs in and the ID stays the same. Call req.session.regenerate() on login.
23
SameSite=Lax doesn't protect you from your own subdomains.
The browser treats your blog subdomain and your app subdomain as the same site, so a form on the blog can post to the app with the user's session cookie. You still need a CSRF token.
2
Login works on localhost. Behind a load balancer, nobody can log in, and there's no error.
With secure: true, express-session drops the cookie because the proxy talks to Node over plain HTTP. Fix: app.set('trust proxy', 1). A number, not true.
youtu.be/lH9bIYoLqvE
16
Don't log users in after a password reset. A reset proves they can read their email, not that they know the password
Free: 57 auth mistakes that fail a security review 👉 blog.alexrusin.com/auth-chec…
7
Your forgot password route can return the same message for every email and still leak which ones have accounts.
5
Setting trust proxy is the right call for rate limiting. It also turns req.hostname into input the client controls. Build your reset link from it, and one forged header sends your user a real reset email pointing at the attacker's site.
youtu.be/-vUXYtyoF58
6
A cookie's Max-Age is an instruction to the browser. An attacker holding your session cookie isn't using a browser.
Check the idle timeout and the absolute timeout on the server, against the session row.
3
The fix for a Cognito logout that signs users straight back in is one redirect to /logout with your client ID and a logout URI.
That URI has to match your allowed sign-out URL exactly, trailing slash included, or Cognito refuses it.
youtu.be/hpqykMCa8jM
4
My Next.js logout deleted the session row and cleared the cookie. One click on Sign in still put me back on the dashboard. No password, no MFA code.
Cognito's managed login keeps its own session, and logout has to end both.
youtu.be/hpqykMCa8jM
3
Rate limiting the "you already have an account" email inside the request handler brings the timing leak right back. The check belongs in the queue worker, after the response has gone out.
youtu.be/6rJGHfEZkSg
10
I made my signup endpoint return the same message for every address. The response time still leaked who had an account. Argon2id only ran for new users, and the median gap was 24.7 ms. Use dummy password hashing for existing accounts to have the same response time.
10
"Email already in use" is a security bug. I sent 500 addresses to a signup endpoint, and that one message picked out all 50 real customers. No login, no password guessing.
youtu.be/6rJGHfEZkSg
8
Login was rate limited. Forgot password wasn't.
50 requests to the reset endpoint sent 50 emails to one user. A flood like that can also burn your sending reputation until legitimate reset emails stop arriving for everyone.
youtu.be/BsinY8p8jAw
5



