Cookie value not updated (related to issue #899?)

Hello,

First of all, thank for your great tool, It seems way more attractive than jmeter.

I want to stresstest a moodle web site, but I have been unsuccessful to simulate the login phase.
Gatling does not catch the update of the value of the “MoodleSession” cookie during the authentication.

During the authentication phase, the application switch from http:// to https://, and reset the value of the MoodleSession cookie (previously set in http://).
I’am not familiar with GIT, and it’s unclear for me if the issue #899 (https://github.com/excilys/gatling/issues/899) is corrected in version 1.4.3.

If it’s related to issue #899, is there a binary version with a fix available somewhere ? Or should I extract the last version of the 1.4 branch and compile it ?
If it’s not related to #899, Can you give me some hints to help me diagnose the problem ?

Thank you.
David.

Abstract of the scenario :

val httpConf = httpConfig
.baseURL( “http://test-moodle.univ-savoie.fr/” )

val scn_exam_user = scenario(“Test-Moodle”)
.feed(userCredentials)
.exec( http(“Home Page”)
.get("/moodle/")
)
.pause(2)
.exec(http(“Authentification Form Display”)
.get(“https://test-moodle.univ-savoie.fr:443/moodle/login/index.php”)
)
.pause(2)
.exec(http(“Authentification Form Submission”)
.post(“https://test-moodle.univ-savoie.fr:443/moodle/login/index.php”)
/**.headers(headers_post_auth)/
.param(“username”, “${username}”)
.param(“password”, “${password}”)
.check( regex(""".
${username}""") )
)

Abstract of the logs :


Request DefaultHttpRequest(chunked: false)
GET //moodle/ HTTP/1.1
Host: test-moodle.univ-savoie.fr
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1
Accept-Language: en-US,en;q=0.8
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22

Response DefaultHttpResponse(chunked: false)
HTTP/1.1 200 OK
Server: Apache/2.2.22
X-Powered-By: PHP/5.3.10-1ubuntu3.5
Set-Cookie: MoodleSession=7371alsqht5meus6q0fhlp1m67; path=/moodle/
Expires: Mon, 20 Aug 1969 09:23:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Language: en

DefaultHttpRequest(chunked: false)
GET /moodle/login/index.php HTTP/1.1
Host: test-moodle.univ-savoie.fr:443
Referer: http://test-moodle.univ-savoie.fr//moodle/
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1
Accept-Language: en-US,en;q=0.8
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22
Cookie: MoodleSession=7371alsqht5meus6q0fhlp1m67; $Path="/moodle/"; $Domain=test-moodle.univ-savoie.fr

Response DefaultHttpResponse(chunked: false)
HTTP/1.1 200 OK
Server: Apache/2.2.22
X-Powered-By: PHP/5.3.10-1ubuntu3.5
Expires:
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Content-Language: en
Content-Script-Type: text/javascript
Content-Style-Type: text/css

Request DefaultHttpRequest(chunked: false)
POST /moodle/login/index.php HTTP/1.1
Host: test-moodle.univ-savoie.fr:443
Referer: https://test-moodle.univ-savoie.fr:443/moodle/login/index.php
Origin: https://test-moodle.univ-savoie.fr
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1
Accept-Language: en-US,en;q=0.8
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22
Cookie: MoodleSession=7371alsqht5meus6q0fhlp1m67; $Path="/moodle/"; $Domain=test-moodle.univ-savoie.fr
Content-Length: 40

Response DefaultHttpResponse(chunked: false)
HTTP/1.1 303 See Other
Server: Apache/2.2.22
X-Powered-By: PHP/5.3.10-1ubuntu3.5
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: MoodleSession=d8pgqq0eclpq3fknd7i71m6291; path=/moodle/
Set-Cookie: MOODLEID1_=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/moodle/
Location: https://test-moodle.univ-savoie.fr/moodle/login/index.php?testsession=5
Content-Language: fr
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
Content-Length: 619

Request DefaultHttpRequest(chunked: false)
GET /moodle/login/index.php?testsession=5 HTTP/1.1
Host: test-moodle.univ-savoie.fr
Referer: https://test-moodle.univ-savoie.fr:443/moodle/login/index.php
Origin: https://test-moodle.univ-savoie.fr
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Cache-Control: max-age=0
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1
Accept-Language: en-US,en;q=0.8
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22
Cookie: MoodleSession=7371alsqht5meus6q0fhlp1m67; $Path="/moodle/"; $Domain=test-moodle.univ-savoie.fr

Response DefaultHttpResponse(chunked: false)
HTTP/1.1 200 OK
Server: Apache/2.2.22
X-Powered-By: PHP/5.3.10-1ubuntu3.5
Expires:
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Content-Language: en
Content-Script-Type: text/javascript
Content-Style-Type: text/css
X-UA-Compatible: IE=edge
Accept-Ranges: none
X-Frame-Options: sameorigin
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 12203

Hi,

I’m not clear, which version of Gatling are you using ? Are you already using the 1.4.3 ?

Cheers
Nicolas

Hi,

Yes, I am already using the 1.4.3 version.
I download the archive gatling-charts-highcharts-1.4.3-bundle.tar.gz the 02/28/2013 from the gatling site.

Best regards
David.

Could you try to remove the port declaration in your script ?

I removed the “:443” part here :

val httpConf = httpConfig
.baseURL( “http://test-moodle.univ-savoie.fr/” )

val scn_exam_user = scenario(“Test-Moodle”)
.feed(userCredentials)
.exec( http(“Home Page”)
.get("/moodle/")
)
.pause(2)
.exec(http(“Authentification Form Display”)
.get(“https://test-moodle.univ-savoie.fr/moodle/login/index.php”)
)
.pause(2)
.exec(http(“Authentification Form Submission”)
.post(“https://test-moodle.univ-savoie.fr/moodle/login/index.php”)
/**.headers(headers_post_auth)/
.param(“username”, “${username}”)
.param(“password”, “${password}”)
.check( regex(""".
${username}""") )
)

Is that workaround working for you ?

I’ll look again in the RFC, but it seems to be a bug in Gatling.

cheers
Nicolas

I try without specifying the port number in the https URLs and the cookie value was correctly update.

So, your workaround is OK for me.

Thank you Nicolas.

Cool !

I created a pull-request with a fix : https://github.com/excilys/gatling/pull/997

cheers
Nicolas