Gatling and cookie deletion

Hi guys,

  First of all thank you for developing Gatling, it's really helpful !

  I'd like to know if Gatling can handle cookies deletion ? Our
scenario goes like this :
  1 - Gatling user (with no session cookie) fills a form and POSTs it
  2 - The application gets the POST request and answers with a HTTP 302
and sets a cookie
  3 - The user gets the 302 and issues a GET, sending along the session
  4 - The application answers with HTTP 200 *and sets the cookie for
  5 - The user deletes its cookie
  6 - The user keeps crawling the application *without the cookie*

  So far I have successfully achieved steps 1-4, but Gatling does not
seem to delete the cookie on step 5.
  Here is the header that the application sends on step 4 to delete
the cookie :
  Set-Cookie:SESS60ca2cdaeae3336ba5e08da8df1dea6b=deleted; expires=Thu,
24-Mar-2011 19:38:58 GMT; path=/;; httponly
  (the date is a few minutes in the past)

  Does Gatling support such headers ? Is there any way to
programmatically remove the session cookie at the next request ?



No, Gatling doesn’t support this yet.
I’ve opened an issue and we’ll fix it for 1.1.1:

Until then, you might write a Session function for deleting it manually, such as:

.exec((session: Session) => {

val cookie:Map[CookieKey, Cookie] = session.getTypedAttribute(“gatling.http.cookies”)

val newCookies = cookie.filter( != “myCookieToBeDeleted”)

session.setAttribute(“gatling.http.cookies”, newCookies)


The problem is that you cannot do it with 1.1.0 because CookieKey was a private class.
I made it public in the master, so if you want to do that, you’ll have to build gatling-http from sources.



2012/3/23 David Hatanian <>

I’ve pushed a fix in the master.
I honestly didn’t test it as I’m supposed to be on vacation, but I’m pretty confident and will check it when I’m back to office.



2012/3/23 Stéphane Landelle <>


Do you have any feedback on the fix?
I’d like to cut the 1.1.1 today or tomorrow.



2012/3/24 Stéphane Landelle <>

Mmmm, strange, it shouldn’t have worked 32A.png

AHC max-age computation is completely wrong and both session cookies (without any max-age or expire) and expired cookies get a -1 max-age.
As a consequence, I was systematically expiring session cookies.
Maybe your cookies are not session ones, that would explain why it worked for you.

I’ve changed my fix so that cookies get deleted according to their value (“deleted”) and I’ll opened an issue on AHC.

Regarding the gatling-charts-highcharts-1.1.1.jar, please have a look at the FAQ:

Thanks for your feedback,