I am working on an application that requires several built-in instances and each of these instances to access the same external site with different authentication information.
I use CEF (built-in Chromium infrastructure) in Delphi, I have a folder in which I stored cookies on it for different instances of my browsers. Therefore, I have this code in the first block
procedure TForm2.Button1Click(Sender: TObject);
begin
form33 := Tform3.Create(nil);
form33.Show;
end;
when created form33
procedure TForm3.FormCreate(Sender: TObject);
var
CookieManager: ICefCookieManager;
folder: string;
begin
Randomize;
Chromium1.SetBrowserID(Random(1244));
folder := Randomtext(5);
if DirectoryExists(folder) = False then
MkDir(folder);
CookieManager := TCefCookieManagerRef.Global;
path := ExtractFilePath(Application.ExeName) + folder;
CookieManager.SetStoragePath(path, true);
end;
The problem is that when I open two or more instances of form33, I cannot have a cookie for each browser in each form33 ...
source
share