koajs / koajs/session

Mechanism to destroy all sessions?

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
908
Forks
115
PR merge metrics
No merged PRs in 30d

Description

I have a use case where the application can be set into a "maintenance mode".

When doing that, I'd like to destroy all current active sessions.

So far I only know that setting a session to `null` in a middleware, will destroy it. But it's mainly for the "sign out" use case.
Could koa-session provide an apocalypse method to destroy all?

Note I am using Redis, so I guess I could delete all session keys but I have more stuff than the sessions in there. I'd rather have a standard method independent of the store.

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by reading the session middleware's handling of a session set to null and the Redis-backed store behavior. Done means defining a standard way to invalidate all active sessions without removing unrelated Redis data, while remaining independent of the session store.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis, typescript
Domain
authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.