Page 1 of 1

Keep multiple sessions

Posted: Fri Oct 18, 2019 4:25 pm
by thefunkyjoint
Hi,

I'm trying to save multiple user sessions in my app. What i want is , the user can fast switch between his logins in a website.

For achieve the results, i'm saving the Cookies files when he logs in the website. When he wants to log with another user, he will logout and login, and then i can save the cookies of this new user with another name. When he wants to switch back to the first login, i recover the first saved cookies file.

But it's not working ; it only works if i save the entire cookies dir (which is about 450 MB), instead of only the Cookies file.

Is there a way to know exactly which files i need to save in order to recover the entire session ?

Thanks

Re: Keep multiple sessions

Posted: Fri Oct 18, 2019 5:15 pm
by salvadordf
Hi,

When you set GlobalCEFApp.DeleteCookies to true, it deletes the "Cookies" and "Cookies-journal" files but I would use another way to switch between users.

There are 2 options :
  • Save the username and passwords for all the users in your application. Let the user click in the logout option in that web page and let the browser manage the cookies. Your application would have to find a way to detect if the current focused HTML element is an input box for the username, show the available usernames and fill the passwords automatically. This is the most complicated option by far.
  • Create a new independent browser with a new request context that uses a different directory for the cache and cookies. Your application would only have to show the available user names and create a browser using the cache directory for that user.

Re: Keep multiple sessions

Posted: Fri Oct 18, 2019 6:08 pm
by thefunkyjoint
salvadordf wrote: Fri Oct 18, 2019 5:15 pm Hi,

When you set GlobalCEFApp.DeleteCookies to true, it deletes the "Cookies" and "Cookies-journal" files but I would use another way to switch between users.

There are 2 options :
  • Save the username and passwords for all the users in your application. Let the user click in the logout option in that web page and let the browser manage the cookies. Your application would have to find a way to detect if the current focused HTML element is an input box for the username, show the available usernames and fill the passwords automatically. This is the most complicated option by far.
  • Create a new independent browser with a new request context that uses a different directory for the cache and cookies. Your application would only have to show the available user names and create a browser using the cache directory for that user.
Sounds like a good plan, will try that, thanks :D