Page 1 of 1
How to delete cookies folder
Posted: Tue Sep 17, 2024 5:43 pm
by thefunkyjoint
I've noticed that , even if i destroy TChromium objects, the cookies folder remains locked and i can't delete it with my application ; the only workaround is to close the application and delete the cookies folder using Windows Explorer.
Any way to delete the cookies without needing to close my app ?

Re: How to delete cookies folder
Posted: Wed Sep 18, 2024 8:33 am
by salvadordf
Try using TChromiumCore.DeleteCookies or TChromiumCore.ClearDataForOrigin with cdstCookies as the aStorageTypes parameter.
Re: How to delete cookies folder
Posted: Wed Sep 18, 2024 1:38 pm
by thefunkyjoint
Thanks, will try... but what i'm trying to understand is, why even after if destroy all TChromium objetcts, the cookies folder is still locked until i close my application . Looks like i still need to do something else in order to 'unlock' the cookies folder

Re: How to delete cookies folder
Posted: Wed Sep 18, 2024 2:17 pm
by thefunkyjoint
I figured out something. Even if i destroy all TChromium objects, there is still 3 or 4 EXE subprocesses of CEF, active on Task manager, so that's probably the culprits to lock the cookies folder.
Is there a way to 'free' everything related to CEF4Delphi on my app, without closing the app ?
What i'm trying to achieve here is, a way to delete ALL cookies folder , but inside my app, without having to close it.
Re: How to delete cookies folder
Posted: Wed Sep 18, 2024 2:42 pm
by salvadordf
Chromium locks the cookie files internally.
Instead of deleting the cookies when you try to close the application try setting the GlobalCEFApp.DeleteCookies property to True before the GlobalCEFApp.StarMainProcess call in the DPR.
That property will delete the cookies before Chromium locks the files.
In any case, using the CEF API with TChromiumCore.DeleteCookies or TChromiumCore.ClearDataForOrigin is the preferred method.
Re: How to delete cookies folder
Posted: Wed Sep 18, 2024 4:34 pm
by thefunkyjoint
Ok, thanks for the info !