-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
Description
What problem does this feature solve?
I have a serverMiddleware with a cookie parser with an internal API (with express).
// Export the server middleware
export default {
path: '/api',
handler: app
}
All work fine client side but when axios request is trigerred server side, axios doesn't add set-cookie. I have to do:
$axios.onResponse((resp) => {
if(resp.headers['set-cookie'] && process.server){
try{
res.setHeader('Set-Cookie', [ resp.headers['set-cookie'] ])
}catch(e) {}
}
return resp
})
Why ?