Set Cookie Command

Description:

This command creates a cookie associated with the specified domain.

Format:

SET COOKIE NAME cookieName VALUE cookieValue DOMAIN domainName [PATH cookiePath] [EXPIRES expireDate] [SECURE];

Parameters:

cookieName

The name of the cookie to be retrieved.

cookieValue

The cookie's value.

domainName

The domain for which the cookie should be set.

cookiePath

The path for which the cookie should be set.

expireDate

The expiration date for the created cookie.

secure

If a cookie is marked secure, it will only be transmitted if the communications channel with the host is a secure one (HTTPS).

Remarks:

Once a cookie has been created with the SET COOKIE command, the HTTP injector will send it as part of the HTTP requests depending on the specified domain, path and expire_date parameters.
Note that if a cookie with the same name already exists, it will be replaced by the newly created one.
Cookies can be deleted using the DELETE COOKIES command.

Example:

string szCookieVar;

SET COOKIE NAME "session-id" VALUE "00000000000" DOMAIN ".AgileLoad.com";

GET COOKIE DOMAIN ".AgileLoad.com" INTO szCookieVar NAME "session-id";
LOG "Session Cookie = " + szCookieVar

Output:

Session Cookie = session-id=00000000000

See Also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap