Gatling 2 Snapshot: How can I get redirect request url?

This is the scenario, go to a.com/home will initial 3 redirects, and finally locate to b.com/randomString. I want to extract the final url “b.com/randomString” and then send a post to it.

check and regex seems not working. I noticed the last redirect has gatling.http.referer in session but I could not get it out. Any ideas? Thanks in advance.

Have you tried currentLocation? https://github.com/excilys/gatling/wiki/Checks#location

currentLocation works but when i send post to b.com/randomString, all cookies from redirection is gone. I think galting handles cookies all by default. Maybe i need to extract cookie from last redirection and set that in my new post request?

Which version do you use? Cookies are supposed to be handled properly, even during a redirect chain.

gatling 2 snapshot, not latest snapshot tho.

How old? IIRC, with fixed such a bug a while ago.

An April version.

a little more information about this.

go a.com
redirect 1: a.com/xx
redirect 2: b.com/1 response header has set-cookie ssid
redirect 3: b.com/2 request header has cookie ssid
redirect 4: b.com/3 response header has no set-cookie

i try to send post to b.com/3, but request doesnt have ssid in cookie so the post fails.

looks like latest gatling snapshot has that issue fixed.

I was pretty sure of it, but glad you confirmed!