Lost Cookie when Following Cached(?) Redirection

Hello! :slight_smile:

I’m new to Gatling and Scala and this time facing the following challenge.

I have a low-level action (function that returns HttpRequestBuilder) which I call twice in my scenario. The first time all works OK, but the second time it seems that when following a redirection the JSESSIONID cookie is not sent and the virtual is effectively logged out hence the test fails.

Here is the log of the first (successful) call. Some details have been removed:

`

18:17:35.127 [DEBUG] i.g.h.e.t.HttpTxExecutor - Sending request=Add Products to Basket uri=https://mywebsite.com/productPage.html: scenario=My Simulation, userId=1

HTTP request:
POST https://mywebsite.com/productPage.html
headers=

cookies=
JSESSIONID=2b-0~D70931583B864103095D98B840D60423, path=/, secure, HTTPOnly
formBody=
CSRF_TOKEN: 1c1cb057ebd50dc1466835a6745dba5c0bba9deac478d50e0b7e4ef0ebaced3942568251f8326e16c6427557b2a17f1bcc89c9de232d4f6c9f5b54845e8422c5

Using disableCache at the http builder level allows the test to continue. I’ll leave this here though in case there is a bug in the caching of redirections.

showBasket.html in the log is supposed to be myBasket.html. I made a mistake when coming up with random page names and stuff! :smiley:

Is there any way for you to provide a reproducer so we can investigate?

Hello! I’ll try to create a standalone reproducer for it and let you know.

Thanks for your help,
George

Would be great! Thanks!