Reputation: 724
I'm using koa-session in my koa-app to store some data. So here is my code:
/*some code*/
app.use(session(app));
/*some code*/
router.get('/test', async (ctx) => {
const {session} = ctx;
console.log(session['test']) // always undefined
session['test'] = 'test'
});
I'm expect to get undefined
on the first request and 'test'
on the other requests, but I'm always getting undefined. What is wrong with this code?
Upvotes: 0
Views: 517