addCookie not work

Code

`

val scn = scenario(“TicketSimulation”)
.exec(addCookie(Cookie(key, value)))
.exec(http(“ticket_get”).get(“some url”))

`

Trace Info

`

Which version do you use?
What do key and value look like?

I’m using 2.0.3, and I’m having same issue:

.exec(addCookie(Cookie("stdo", f3188321-a82d-42ea-80e5-b0f57ff6e9fb")))
.exec(
  http("Request 1")
    .post(s"${theUrl}/api/")

)

The request doesn’t have the cookie I’m adding.

Quote from the group rules/advices:

“Check that you’re not running an old version and that upgrading doesn’t fix your problem”

Well, I didn’t tell you the whole history. I’m not using Gatling directly, I’m using the SBT Gatling plugin, and I’m not able to use the latest version of Gatling/plugin, given that all of the projects we are working on, use Scala 2.10, and we found issues when trying to use the latest version of the plugin with Scala 2.10 (https://groups.google.com/forum/#!topic/gatling/pSrJTs-ohQU).

So, we have to stick to Gatling 2.0.3, which has been working great so far, until this point, where I don’t know why the cookie is not set.

Thanks in advance for your help.

Except if you have strong dependencies to some internal libraries, you’d better move the Gatling stuff to a dedicated project/module where classpaths don’t clash. I’m 100% sure the issue you’re facing is fixed in 2.1.

Otherwise, sadly, as an open source project, we can’t afford maintaining many concurrent versions.

Moving our simulations into a dedicated project contradicts the main reason why we are using the plugin: we want to be able of manage and do version control of our perforamnce test assets in conjunction with the code base; Anyway, I understand what you’re saying about the open source project.

Thanks for your help, and for answering so fast.

Cheers.

You could perfectly have a submodule in your project that uses a different Scala version.

I had the same issue which I managed to fix by specifying a maxAge on the the cookie :

`
val scn = scenario(“TicketSimulation”)
.exec(addCookie(Cookie(key, value).withMaxAge(Int.MaxValue)))
.exec(http(“ticket_get”).get(“some url”))

`

I also had to specify baseUrl on the http protocol. Should work if you specify the domain on cookie as well.