NettyCookie changing name uenxpectedly between client and server

17 Views Asked by At

The setup:

I have a micronaut http server and a client which communicate together. Sometimes the server will return back cookies, when doing a login request for example. The cookies have the following names: __Host-session_expiry and __Host-session. Both are have domain=null, path=/ and secure=true. Their only difference is httpOnly, for the session_expiry cookie it is set to false, and the other one is set to true.

When the client receives cookies in the response, I store them in a map and then when I add them to the next request.

The problem:

When the service receives the original cookies it would have sent to the client in the previous request, the __Host-session_expiry is set as _Host-session_expiry (notice the missing underscore).

I have no idea why this happens. After debugging, the client is putting the expected cookies in the HttpRequest, but somehow the service is not receiving what is being sent.

Also, when I try this from postman, instead of using the micronaut http client, it works as expected.

Any ideas on why the __Host-session_expiry is being sent as _Host-session_expiry ?

I tested the above scenario locally (both in tests and also deployed on docker locally) and it worked fine. However when deploying to k8s it does not work and I get the issue with the missing underscore as mentioned above.

0

There are 0 best solutions below