Internet Direct (Indy) Version 9.0.1 Beta
TIdCookieManager.GenerateCookieList
Generates text containing Cookie values that match the specified values.

function GenerateCookieList(URL: TIdURI; SecureConnection: Boolean): String;
Parameters
URL: TIdURI
URI specifying the Host and Path for valid Cookie content.

SecureConnection: Boolean = false
Indicates if a Secure connection is required. Default value is False.

Returns
String - Textual representation of the matching Cookies.

Description
GenerateCookieList is a String function that generates the textual content for Cookies in the CookieCollection that match the Domain and Path for the location specified in URL in the HTTP server request.

SecureConnection indicates whether Cookies must contain a Secure attribute value before they are included in the generated Cookie content for the HTTP client.

Cookies in the CookieCollection will not be used in the generated content when Domain, Path, or Secure Cookie attributes do not match the required values. Cookies can also be ignored when they have Expired.

GenerateCookieList creates and populates a TIdCookieList with COokie class instances matching the required values, and fills the return value with the CookieName and Value for corresponding Cookies in the list. GenerateCookieList frees the TIdCookieList prior to exiting from the method.

GenerateCookieList is called when an HTTP request is prepared and executed using the TIdHTTP Post or Put methods.