koajs / koajs/session

Expired session is not empty.

Open
#169 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 need to check session is empty. After session expired, using console.log of session returns {}. But when I try Object.keys(session).length, it's not 0 even there's no property in the session.

So I try print session directly and now it shows me like this:

```javascript
console.log('Session: ', context.session); // {}
console.log('Keys: ' + Object.keys(context.session)); // _sessCtx,_ctx,isNew
```

How do I guarantee that session is expired and it's empty?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported behavior around context.session after expiration, comparing console.log(session) with Object.keys(session). The issue names no source file or test; done would require establishing whether the expired session is correctly detectable and empty, then documenting or correcting the observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.