"Invalid redirect to the same request" error upon 302 Redirect with Set-Cookie header

Hi again,

Upgrading to 3.4.2 from 2.3.x spawns a new error in our Gatling scenarii:

Invalid redirect to the same request

This looks like the result of https://github.com/gatling/gatling/issues/3480 , which is implemented by https://github.com/gatling/gatling/blob/3.4/gatling-http/src/main/scala/io/gatling/http/engine/response/RedirectProcessor.scala

As far as I can tell, the error should occur only when the requested URI equals the target redirect URI with same method and same set of cookies.

The app is indeed responding with a redirect to the same URI, but with a different cookie: the 302 response does contain a Set-Cookie with a different value.
This happens during the logout process, which is a quite common pattern: session invalidation occurs server-side and a new session id is generated, leading to setting the new session id as a cookie in the 302 response.

It looks like the Set-Cookie from the 302 response is disregarded…

Here is the HTTP dump from Gatling:

gatling.http.cookies → CookieJar(Map(CookieKey(jsessionid,redact.host,/app) → StoredCookie(JSESSIONID=4F49E96F2E86A78A2F507053811945A3, path=/app, HTTPOnly, SameSite=Lax,true,false,1607528569673)))

From https://groups.google.com/g/gatling:

  • Provide a Short, Self Contained, Correct (Compilable), Example (see http://sscce.org/)

From https://groups.google.com/g/gatling:

  • Provide a Short, Self Contained, Correct (Compilable), Example (see http://sscce.org/)

Fair enough, here you go.

File nginx.conf:

Thanks!
Fixed: https://github.com/gatling/gatling/issues/4028

Thanks a ton. :slight_smile:
As usual… any foreseen date for the 2.5.0 release? :wink:
Or any way to work around this problem in the meanwhile?
Rgds
Pascal D

Planned for Monday along with FrontLine 1.13.0

Wow, that’s fast!
You rock, guys. (Y)