Menu

Why Your Bank Logs You Out in 5 Minutes but Other Sites Keep You Signed In for Weeks
📰

Why Your Bank Logs You Out in 5 Minutes but Other Sites Keep You Signed In for Weeks

DEV Community: authentication·Yazan zozopeak·2 days ago
#ovfUv65P
Long article (737 words) — no AI summary yet.
Reading 0:00
15s threshold

You've noticed this your whole life as a user: your banking app signs you out after a few minutes of inactivity, while the forum you registered on three years ago still greets you by name. That's not an accident or a bank being paranoid for fun. It's two different, deliberate configurations of the same mechanism: session expiration.

This post breaks down how session timeouts actually work, what the OWASP Session Management Cheat Sheet recommends, and how to pick values for your own app.

The cookie underneath

Most web sessions are just a cookie holding a long random ID. The server keeps the real state (who you are, what you're allowed to do) and looks it up by that ID on every request.

Cookies come in two flavors, and the difference matters:

Session (non-persistent) cookies have no Expires or Max-Age attribute.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.