Multiple instance cookie & cache problem.

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Multiple instance cookie & cache problem.

Postby shileiyu » Wed Sep 26, 2012 3:29 am

consider following scenario:
1. A program has integrate with CEF.
2. The program need lunch multi instance.
3. Web cache cookie should be shared among all instances.

I'v tried running two cefclient instance with same cache-path at same time. no crash happened, but the second instance didn't open open any cache file(those data_* files in cache path).it seem like cache mechanism isn't work at all in the second instance.

To solve this problem. Maybe following approach is considerable: We can consider CEF as a master process instead of a module loaded by user. We can give the process a user defined tag, so it's possible running several master CEF processes working for different user. User interact with their CEF master process by IPC. User send Mouse/Keyboard Event to CEF master process, and master paint web contents to native window indicate by user or let user read image data from master process(off-screen mode). So no mater how many user instance get running, there is only one master process running. so this problem get solved.

May I start a issue to discuss this problem?
shileiyu
Newbie
 
Posts: 9
Joined: Thu Dec 09, 2010 10:52 am

Re: Multiple instance cookie & cache problem.

Postby magreenblatt » Wed Sep 26, 2012 9:28 am

Two separate process instances of CEF cannot share the same cache_path as you've discovered. Why do you need separate processes? Most web browsers for example use a single application process. When you attempt to launch the web browser a second time it delegates the request to the already existing process.

The approach that you describe using IPC messages to share CEF state between multiple application processes would likely work. However, it is outside the scope of the CEF project.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Multiple instance cookie & cache problem.

Postby shileiyu » Wed Sep 26, 2012 8:20 pm

I need sharing cookie and cache in different application(different executable). Is there any easy way to do so? except build a "master" CEF process? Could I handle cache and cookie by CEF's cookie and request interface?

If there is no way to do this without build a "master" CEF process. would you like funding a new project(maybe a side-project) base on CEF?
shileiyu
Newbie
 
Posts: 9
Joined: Thu Dec 09, 2010 10:52 am

Re: Multiple instance cookie & cache problem.

Postby magreenblatt » Thu Sep 27, 2012 9:25 am

shileiyu wrote:Could I handle cache and cookie by CEF's cookie and request interface?

Yes. For example, you can use CefCookieManager and some type of shared memory system, database service, etc.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 149 guests