Page 1 of 1
Browsers with cookies session separated
Posted: Wed Dec 13, 2017 12:49 am
by alpires2000
Hi guys, exist some way to put 2 browsers in a page control but with cookies session separated?
I need log-in in same site but in 2 different accounts.
Thanks for some help
Alexandre
Brazil
Re: Browsers with cookies session separated
Posted: Wed Dec 13, 2017 9:40 am
by salvadordf
Hi,
Yes, the MDIBrowser demo can do that.
By default, all browsers share the same "context". That means that all of them share the cache and cookies.
You need to create a new "context" for each independent browser. Each context can be created using a different cache directory or in memory, leaving the cache parameter blank.
Re: Browsers with cookies session separated
Posted: Wed Dec 13, 2017 3:17 pm
by alpires2000
Hi, thanks, but MDIBrowser demo dont works here, the browser dont appears the windows stay blank.
Some idea?
Re: Browsers with cookies session separated
Posted: Wed Dec 13, 2017 3:48 pm
by alpires2000
OK, I do this: TempContext := TCefRequestContextRef.New('', '', False, False, False, False);
Works well, but how set the context to uses the cache path configured in GlobalCEFApp.cache?
Re: Browsers with cookies session separated
Posted: Thu Dec 14, 2017 9:48 am
by salvadordf
alpires2000 wrote: Wed Dec 13, 2017 3:17 pm
Hi, thanks, but MDIBrowser demo dont works here, the browser dont appears the windows stay blank.
Some idea?
Sorry. I left some test code by mistake.
Please download CEF4Delphi again.
alpires2000 wrote: Wed Dec 13, 2017 3:48 pm
OK, I do this: TempContext := TCefRequestContextRef.New('', '', False, False, False, False);
Works well, but how set the context to uses the cache path configured in GlobalCEFApp.cache?
The first parameter in TCefRequestContextRef.New is the cache directory but if you want them to share the cache you shouldn't create a different context.