There is a Chrome extension called 'Cookie editor'. With this i can navigate for instance, to www.Facebook.com and export the cookies of my logged session in JSON format.
Is there a way to import these cookies , so my CEF4Delphi application can be automatically logged on the same session ? This would be a great feature and would avoid the need to log on the same site you are already logged in Google Chrome.
PS : Or even better, is there a way to read Google Chromes directly and import them for our CEF4Delphi app ?
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Import cookies in JSON format
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Import cookies in JSON format
Hi,
The CookieVisitor demo is capable of adding cookies manually but CEF doesn't have any API method to read the cookies from Chrome.
If the JSON file has all the unencrypted cookie values then you can use the code in CookieVisitor to import them after reading the JSON contents like this :
https://stackoverflow.com/questions/4350886/how-to-parse-a-json-string-in-delphi
The CookieVisitor demo is capable of adding cookies manually but CEF doesn't have any API method to read the cookies from Chrome.
If the JSON file has all the unencrypted cookie values then you can use the code in CookieVisitor to import them after reading the JSON contents like this :
https://stackoverflow.com/questions/4350886/how-to-parse-a-json-string-in-delphi
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Import cookies in JSON format
Thanks, i'll have a look on the demo.