1
쿠키를 HttpOnly로 정의하면 서버가 다시 시작된 후 request.state
에서 쿠키가 사라집니다. 이것은 HttpOnly 사양의 일부로 보이지 않습니다. HapiJS에서이 문제를 해결할 방법이 있습니까?Hapijs - 서버를 다시 시작하면 HttpOnly 쿠키가 사라집니다.
// cookie definition
server.state('my_cookie', {
ttl: YEAR_IN_MS,
isSecure: false,
isHttpOnly: true,
encoding: 'base64json',
clearInvalid: false,
strictHeader: true,
path: '/'
}
server.ext('onPreResponse', function(request, reply) {
console.log(request.state.my_cookie) // returns undefined after server restart
reply.continue()
})