Page 1 of 1

How to get all the document Cookies?

Posted: Mon Nov 18, 2019 7:58 am
by ForestListener
Hello, Salvador.

I have to ask, because i cant figure it out now by myself.

I need to get all the cookies from current Webpage.

I've used Javascript command document.cookie but this command do not retrieve all the Cookies.

For example. Full set of Google com cookies is

Code: Select all

1P_JAR: 2019-11-18-07
ANID: ***
NID: ***
Javascript command document.cookie retrieves only

Code: Select all

1P_JAR: 2019-11-18-07
Is there function to retrieve all the Cookies from opened Webpage.

Thank you!

Re: How to get all the document Cookies?

Posted: Mon Nov 18, 2019 8:07 am
by salvadordf
Hi,

Call TChromium.VisitAllCookies or TChromium.VisitURLCookies and you will receive the cookies in the TChromiumCore.OnCookiesVisited event.

TChromiumCore.OnCookiesVisited will be triggered several times, one for each cookie. If there are no cookies then it will not be triggered.

The TChromium.OnCookieVisitorDestroyed event will always be triggered when all this process is over.