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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Browsers with cookies session separated

Post Reply
alpires2000
Posts: 52
Joined: Sat Dec 09, 2017 4:40 pm

Browsers with cookies session separated

Post 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
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Browsers with cookies session separated

Post 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.
alpires2000
Posts: 52
Joined: Sat Dec 09, 2017 4:40 pm

Re: Browsers with cookies session separated

Post by alpires2000 »

Hi, thanks, but MDIBrowser demo dont works here, the browser dont appears the windows stay blank.
Some idea?
alpires2000
Posts: 52
Joined: Sat Dec 09, 2017 4:40 pm

Re: Browsers with cookies session separated

Post 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?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Browsers with cookies session separated

Post 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. :oops:
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.
Post Reply