enhance-dev/arc-plugin-enhance

Session is not stored in _idx cookie when using middleware syntax

Closed this issue · 0 comments

I've noticed that the returned session data isn't written to the _idx cookie if you use the array based middleware format.

eg.:

async function one (req) {
  console.log(req.session)
  req.session.test = "hello"
}

async function two (req) {
  console.log('hi from two')
  console.log(req.session)
  
  return { 
    session: req.session,
    json: {test: 'one'}
  }
}

No cookie is written.

However, if I use a single response handler get function, the session would be stored correctly in _idx