Skip to main content

Inserting, Listing, and Deleting Cookies

Inserting, Listing, and Deleting Cookies

%Net.HttpRequestOpens in a new tab automatically manages cookies sent from the server; if the server sends a cookie, your instance of %Net.HttpRequestOpens in a new tab will return this cookie on the next request. (For this mechanism to work, you need to reuse the same instance of %Net.HttpRequestOpens in a new tab.)

Use the following methods to manage cookies within your instance of %Net.HttpRequestOpens in a new tab:

InsertCookie()

Inserts a cookie into the request. Specify the following arguments:

  1. Name of the cookie.

  2. Value of the cookie.

  3. Path where the cookie should be stored.

  4. Name of the machine from which to download the cookie.

  5. Date and time when the cookie expires.

GetFullCookieList()

Returns the number of cookies and returns (by reference) an array of cookies.

DeleteCookie()

Deletes a cookie from the request.

Remember that cookies are specific to an HTTP server. When you insert a cookie, you are using a connection to a specific server, and the cookie is not available on other servers.

For details on these methods, see the class documentation for %Net.HttpRequestOpens in a new tab.

FeedbackOpens in a new tab