WebCookieListNext Function

Action

Lists the next cookie found in the cookie database. Use this function after a successful WebCookieListFirst function call.

Note: This function waits for all threads to finish before listing the data.

Include file

WebAPI.bdh

Syntax

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

Return value

  • true if a cookie is found

  • false if the end of the cookie database is reached

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