koajs / koajs/session

session存储在mysql中,当cookie过期了,怎么删除msyql中的session?

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

Description

You can store the session content in external stores (Redis, MongoDB or other DBs) by passing options.store with three methods (these need to be async functions):

get(key, maxAge, { rolling }): get session object by key
set(key, sess, maxAge, { rolling, changed }): set session object for key, with a maxAge (in ms)
destroy(key): destroy session for key

这里不能获取失效的key

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by tracing the options.store get, set, and destroy contract alongside cookie maxAge handling; determine how an expired cookie should trigger cleanup, then add a regression test confirming that the corresponding MySQL session is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.