Contents - Index - Top


GetCookiesAsJsonSync

Interface AntViewCookieManager

 

Type: Method

Parameters: string uri string Cookies

Returns: Integer

 

 

Retrieve all cookies matching the uri synchronously as a json string. If the uri parameter is left empty then it will return all cookies for the User Profile regardless of what domain the cookie is stored under.

 

The cookies are returned in parameter cookies as a string in json format, where all fields of each AntViewCookie are enumerated.

For example it  can look like this:

 

{"cookies":

  [{"item":0,

    "domain":"www.antwise.com",

    "expires":"1969-1231T15:59:59.000Z",

    "httpOnly":false,

    "isSession":true,

    "name":"three",

    "path":"/demo",

    "sameSite":1,

    "secure":false,

    "value":"choco"

   },

   {"item":1,

    "domain":"www.antwise.com",

    "expires":"1969-12-31T15:59:59.000Z",

    "httpOnly":false,

    "isSession":true,

    "name":"two",

    "path":"/demo",

    "sameSite":1,

    "secure":false,

    "value":"coconut"

   },

   {"item":2,

    "domain":"www.antwise.com",

    "expires":"1969-12-31T15:59:59.000Z",

    "httpOnly":false,

    "isSession":true,

    "name":"one",

    "path":"/demo",

    "sameSite":1,

    "secure":false,

    "value":"blueberry"

  }]

}

 

If there was an error the method will return a non zero value.

 

The function returns:

  0 when the cookies have been found the result is in the Cookies parameter, 

  21 function is already running (can only run one at a time)

  22 function timed out

  23 CookieManager is not connected to WebView2 control

  25 Trying to run a synchronous method from within a WebView2 event

 

 

Examples:

PowerBuilder - Cookie management example

VB6 - Cookie Synchronous example

VFP - Cookie Synchronous example

 

Introduced in AntView release 2.0.567

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 11/05/2025