Save and restore cookies
Posted: Tue Sep 13, 2022 8:32 pm
Hello, a question about adding cookies using TCefCookieManagerRef and the SetCookie function. I need to save cookies from some sites when I close the program, and these cookies need to be recreated at startup. Confuses the "url" parameter in the SetCookie function, since I get the cookie data using TCefFastCookieVisitor but it does not have the "url" parameter.
It turns out that when the program starts, I read the cookies that were saved and I don’t know what URL to specify when creating it. In theory, you can look at the "domain" parameter, but here another question arises, we do not know what to substitute "http" or "httpS" in front. After all, the domain of the site looks like "site.com" or ".site.com".
Could you tell me how to correctly substitute the "url" parameter in the SetCookie function?
Thank you.
It turns out that when the program starts, I read the cookies that were saved and I don’t know what URL to specify when creating it. In theory, you can look at the "domain" parameter, but here another question arises, we do not know what to substitute "http" or "httpS" in front. After all, the domain of the site looks like "site.com" or ".site.com".
Could you tell me how to correctly substitute the "url" parameter in the SetCookie function?
Thank you.