WebCookieGet Function

Action

Returns the cookie header for the specified URL once all threads have finished their tasks.

Include file

WebAPI.bdh

Syntax

WebCookieGet( out sCookie    : string,
              in  nMaxCookie : number,
              in  sUrl       : string): boolean;

Return value

  • true if a cookie is found

  • false otherwise

Parameter Description
sCookie Buffer that receives the cookie header if WebCookieGet succeeds
nMaxCookie Specifies the size of the sCookie buffer. Specify STRING_COMPLETE to get all received data.
sUrl URL for which to get cookies

Example

dclfunc
  function CookieGet(sUrl: string)
  var
    sCookieBuffer: string;
  begin
    if WebCookieGet(sCookieBuffer, STRING_COMPLETE, sUrl) then
      write("["); write(sCookieBuffer); write("] to URL: ");
      write(sUrl); writeln;
    else
      write("no appropriate cookie found! - URL: ");
      write(sUrl); writeln;
    end;
  end CookieGet;

SilkEssential sample

Cookies.sep