Skip to main content
🎊 We've changed our name from Ddosify to Anteon! 🚀

🍪 Cookies

Ddosify supports cookies in the following engine modes: distinct-user and repeated-user. Cookies are not supported in the default ddosify mode.

In repeated-user mode, Ddosify uses the same cookie jar for all iterations executed by the same user. It sets cookies returned at the first successful iteration and does not change them afterward. This way, the same cookies are passed through steps in all iterations executed by the same user.

In distinct-user mode, Ddosify uses a different cookie jar for each iteration, so cookies are passed through steps in one iteration only.

You can see a cookie example in the examples.

Initial / Custom Cookies

You can set initial/custom cookies for your test scenario using cookie_jar field in the config file. You can enable/disable custom cookies with enabled key. Check the example config.

KeyDescriptionExample
nameThe name of the cookie. This field is used to identify the cookie.platform
valueThe value of the cookie. This field contains the data that the cookie stores.web
domainDomain or subdomain that can access the cookie.app.getanteon.com
pathPath within the domain that can access the cookie./
expiresWhen the cookie should expire. The date format should be rfc2616.Thu, 16 Mar 2023 09:24:02 GMT
max_ageNumber of seconds until the cookie expires.5
http_onlyWhether the cookie should only be accessible through HTTP or HTTPS headers, and not through client-side scriptstrue
secureWhether the cookie should only be sent over a secure (HTTPS) connectionfalse
rawThe raw format of the cookie. If it is used, the other keys are discarded.myCookie=myValue; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Path=/

You can capture values from cookies from its name just like you do for headers and body and use them in your test scenario.

{
"iteration_count": 100,
"load_type": "linear",
"duration": 10,
"steps": [
{
...
"capture_env": {
"TEST" :{"from":"cookies","cookie_name":"test"}
}
}
]
}

You can refer to cookie values as cookies.cookie_name while you write assertions for your steps.

Following fields are available for cookie assertion:

  • name: Name of the cookie
  • domain: Domain of the cookie
  • path: Path of the cookie
  • value: Value of the cookie
  • expires: Expiration date of the cookie
  • maxAge: Max age of the cookie
  • secure: Secure flag of the cookie
  • httpOnly: Http only flag of the cookie
  • rawExpires: Raw expiration date of the cookie

Examples

  • cookies.test.expires < time(\"Thu, 01 Jan 1990 00:00:00 GMT\") is a valid assertion expression. It checks if the cookie named test has an expiration date before Thu, 01 Jan 1990 00:00:00 GMT.
  • cookies.test.path == \"/login\" is another valid assertion expression. It checks if the cookie named test has a path value equal to /login.