Internet Direct (Indy) Version 9.0.1 Beta
TIdCookies.GetCookieIndex
Indicates the index position of a Cookie containing specified values.

function GetCookieIndex(FirstIndex: integer; const AName: string): Integer; overload;
function GetCookieIndex(FirstIndex: integer; const AName: string; const ADomain: string): Integer; overload;
Parameters
FirstIndex: integer
Initial position to be examined in the collection.

const AName: string
Cookie name to be matched.

const ADomain: string
Domain attribute to be matched.

Returns
Integer - Position of the matched Cookie in the collection, or -1 when not found.

Description
GetCookieIndex is an overloaded Integer function that accesses Cookie class instances in the collection to determine the position of the collection item matching the specified search criteria. GetCookieIndex will return the value -1 when a Cookie cannot be located in the collection that matches the specified search criteria.

FirstIndex specifies the initial position in the container to be used when comparing values in the AName and/or ADomain parameters.

AName is the CookieName value desired in a Cookie collection item.

ADomain is the Domain value desired in a Cookie collection item.

GetCookieIndex is called from the GetCookie method to locate one of the Items in the collection that match a specified Name and Domain.