Relaying cookies in subsequent requests

Hi
I seem to have a problem with relaying session identification cookie to subsequent requests after initial login.
Here is a very simple simulation that I am trying to run (with actual URLs removed):

package basic

import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._

class MluiSearchAPISimulation extends Simulation {

val main_httpConf = httpConfig
.baseURL(“https://mylocalserver:8443/mlui/home/search”)
.acceptCharsetHeader(“ISO-8859-1,utf-8;q=0.7,;q=0.3")
.acceptHeader("text/html,application/xhtml+xml,application/xml,application/json,text/javascript;q=0.9,
/*;q=0.8”)
.acceptEncodingHeader(“gzip,deflate,sdch”)
.acceptLanguageHeader(“en-US,en;q=0.8”)

val main_scn = scenario(“Index (empty initial index)”)
.exec(
http(“login_page”)
.get(“https://externalLoginServer/login/”)
.check(status.is(200)))
.pause(2 seconds)
.exec(
http(“login_form_post”)
.post(“https://externalLoginServer/login.sdo”)
.param(“luser”,"")
.param(“lpass”,"")
.param(“cookiesEnabled”,“true”)
.param("_save",“Login”))
.pause(2 seconds)
.exec(
http(“index_request_1”)
.post("/index")
.param(“fileId”,“100”)
.param(“imageTitle”,“sunset in the mountains.jpg”)
.param(“imageDescription”,“beautiful sunset in the mountains”)
.param(“tags”,“sunset mountains”)
.check(status.is(200)))

// run the scenario with 1 user making 1 index index request
setUp(main_scn.users(1).protocolConfig(main_httpConf))
}

I need a specific cookie named “sso_so” to be relayed to my local server after login. That cookie serves as a session identifier of sorts.
What I have noticed, is that in the response that I get from the login request, I get the following 4 headers( this is according to Chrome built-in debugger):

  1. Set-Cookie:
    BIGipServerD100_SSO=1404872896.36895.0000; Path=/

  2. Set-Cookie:
    d1_sso_cid=d1-sso952; Path=/; domain=.; Secure; HttpOnly

  3. Set-Cookie:
    Domain=.; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/

  4. Set-Cookie:
    sso_so=QPCaGeod2Mlsi9ICU1Jbo9PiT24rNO7H3GDXJs4tWbFglooOHHIF8mJDcLx; Path=/; domain=.; Secure; HttpOnly

As you can see, the last header contains the necessary cookie. But it somehow does not get relayed when I send the last request in the chain.

Could it be that:

a. Since domain of login server and my local server are different - Gatling does not relay the cookie?
b. Since there is more than one header in the response with the name “Set-Cookie”, the one with the right cookie value gets overridden somewhere inside of Gatling?

Thanks in advance for your time!

Hi,

Why version of Gatling do you use?

If I am not mistaken, 1.4.1.

A similar issue was fixed in 1.4.3: https://github.com/excilys/gatling/wiki/Changelog#wiki-1.4.3

Could you upgrade and try again, please?

I will try in the next few hours. Will report if the issue went away.
Thank you for quick response!

Hi Stéphane
1.4.3 build worked for the scenario that I was describing.
Problem solved.
Thanks for quick response!

I’m glad :slight_smile: