WebCookieListFirst Function

Action

Lists the first cookie found in the cookie database. This function waits for all threads to finish before listing the data.

Include file

WebAPI.bdh

Syntax

WebCookieListFirst( out sCookie    : string,
                    in  nMaxCookie : number optional,
                    in  nOptions   : number optional): boolean;

Return value

  • true if a cookie is found

  • false otherwise

Parameter Description
sCookie Buffer that receives the cookie header.
nMaxCookie Specifies the size of the sCookie buffer (optional). Specify STRING_COMPLETE to get all received data.
nOptions

(optional)

WEB_COOKIE_FLAG_DONT_FORCE_DOMAIN
Specifies that the domain of the cookie should only be included if it was originally specified when the cookie was entered into the cookie database.

Example

// This function shows how to list cookies stored
// in the cookie database
dclfunc
  function WebCookieList(nOptions : number optional)
  var
    bCookie       : boolean;
    sCookieBuffer : string;
  begin
    write("------ cookie database ------"); writeln;
    bCookie := WebCookieListFirst(sCookieBuffer, STRING_COMPLETE, nOptions);
    while bCookie do
      write(sCookieBuffer); writeln;
      bCookie := WebCookieListNext(sCookieBuffer, STRING_COMPLETE, nOptions);
    end;
  end WebCookieList;

SilkEssential sample

Cookies.sep