You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cookies challenge has proved for me to be the most tricky challenge. I am still not sure that
I have got it right for my taste. Because of the stated cookie parsing error.
Note that these config options are only set for the /set-cookie route:
config: {state: {parse: true,failAction: 'log'}}
After reading the Hapi docs about cookie parsing, I would actually expect it to be present on the /check-cookie route in the first place as that route is responsible for the cookie validation.
However, adding it to the the /check-cookie route invalidated the official verify.
So, I have also added the recommended error handler for cookie parsing problems:
I had the exactly same error, using latest hapi 14.1.0.
It seems the Expires key gets an invalid value.. I don't know if that challenge worked before, but a 10 ms ttl (that governs the Expires value) seems unreasonable to me. Both the legacy Expires setting and the newer Max-Age one have a precision of 1 second, so how can u set it to 10 ms?
I think this is a bug in the exercise, ttl should be set to at least 1000 ms..
@madrus
Hi,
Maybe you cookie format is not RFC 6265.
So,
const server = new Hapi.Server({
connections: {
state: {
// If your cookie format is not RFC 6265, set this param to false.
strictHeader: false
}
}
});
The
Cookies
challenge has proved for me to be the most tricky challenge. I am still not sure thatI have got it right for my taste. Because of the stated cookie parsing error.
Note that these
config options
are only set for the/set-cookie
route:After reading the Hapi docs about cookie parsing, I would actually expect it to be present on the
/check-cookie
route in the first place as that route is responsible for the cookie validation.However, adding it to the the
/check-cookie
route invalidated the officialverify
.So, I have also added the recommended error handler for cookie parsing problems:
Now, I could get a more detailed information of the cookie parsing error.
It looks like the
Expires
key has an invalid datetime value although it looks perfectly ok to me.Is this a bug or is it by design?
The text was updated successfully, but these errors were encountered: