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.

Cookies vs multiple users

Post Reply
Pieter E.
Posts: 12
Joined: Thu Oct 19, 2017 2:47 pm

Cookies vs multiple users

Post by Pieter E. »

Hi,

In one of my projects I am using CEF4. CEF4 works as a charm. My project contains several end users. Based on their credentials users can login. Users have the option to use CEF4 to browse the internet. CEF4 is using cookies. My problem is when users login and use CEF4 there is no difference in use of cookies. This means that cookies are shared among users. When sharing cookies among users, users auto login on websites from other user sessions. I am wondering if it is possible to separate cookies for each user. If so, can someone please inform me how to achieve this? I am using C++ Builder 10.2 and the latest CEF4.

Thank you in advance for your help.
User avatar
salvadordf
Posts: 4572
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cookies vs multiple users

Post by salvadordf »

Hi,

You can use a different cache directory for each user. There are 3 ways to do that :
  • If you use the same EXE for all the CEF subprocesses then create a new request context and use a different the cache parameter for each user. Read this for more information :
    https://www.briskbard.com/forum/viewtop ... 122&p=4873
  • If you use a different EXE for the CEF subprocesses you can initialize CEF4Delphi after the user is authenticated and use a different GlobalCEFApp.cache for each user.
  • Ideally, each user would have a different Windows user and your application would use a cache directory inside the AppData directory for each user.
Pieter E.
Posts: 12
Joined: Thu Oct 19, 2017 2:47 pm

Re: Cookies vs multiple users

Post by Pieter E. »

Hi Salvardordf,

Thank you for your answer. I forgot to use the default user folders. Your third solution woke me up. :D :D :D

Thank you!
Post Reply