Closed OuyangMr closed 7 years ago
As your code has a destory
strategy:
`// if not changed
if(old == JSON.stringify(ctx.session)) return;
// clear old session if exists
if(id) {
await store.destroy(id);
// set it to undefined instead of null to be able to use default parameters at Store
id = undefined;
}`
I resolve it by using ctx.session = {};
@OuyangMr you can set session a null
or empty string
or something false
, it will be destroyed. 😄
I got this error when try to destroy a session:
TypeError: ctx.session.destroy is not a function
app:ctx.session.destroy();
Why not give a
destroy()
method to Session? And how can I destroy a session simply?