Hi, how does ORY Kratos handle browser sessions? W...
# talk-kratos
p
Hi, how does ORY Kratos handle browser sessions? Where the cookie is set to expire on browser close? I would think that the session data sticks around right, and is still valid?
p
Hi @polite-river-58556 Kratos issues an httpOnly cookie with an expiry date. You can of course also invalidate the session by logging the user out through the API or through the Admin API.
b
@proud-plumber-24205 What happens when the cookie doesn't have an expiration date / gets removed on browser close? The session would still be active on the server right
Or is that not really an issue and the session gets cleared up eventually by some cronjob that checks for expired sessions in the database
@steep-lamp-91158 perhaps you know this?
s
I think there is currently no cleanup job, but we will add it eventually
When the browser "forgets" the session, an attacker has to guess the session cookie to gain access to that session (same as when the browser still has the cookie).
b
@steep-lamp-91158 so the session just lingers around forever?
s
ah no it seems this was done already https://github.com/ory/kratos/pull/2406