How to implement auto log on in a simple CEF3 Browser

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

How to implement auto log on in a simple CEF3 Browser

Postby wuzebin55 » Thu Feb 05, 2015 7:11 am

My win32 app was a light browser based on CEF3
after I log on a specify URL i hope it will automatically login on when i navigate to the same URL in another CEF3 Browser Process

what should i do to make it right?
wuzebin55
Techie
 
Posts: 17
Joined: Thu Feb 05, 2015 7:05 am

Re: How to implement auto log on in a simple CEF3 Browser

Postby magreenblatt » Thu Feb 05, 2015 1:29 pm

Are you running multiple CEF browser processes at the same time, or do you just want to persist the data past shutdown/restart? If the former then you'll need to store the information externally -- in a file that your application writes, for example. If the latter then you can use cookies or localStorage from the JavaScript application and persist the data to disk by specifying a cache path value via CefSettings.cache_path.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: How to implement auto log on in a simple CEF3 Browser

Postby wuzebin55 » Thu Feb 05, 2015 8:33 pm

magreenblatt wrote:Are you running multiple CEF browser processes at the same time, or do you just want to persist the data past shutdown/restart? If the former then you'll need to store the information externally -- in a file that your application writes, for example. If the latter then you can use cookies or localStorage from the JavaScript application and persist the data to disk by specifying a cache path value via CefSettings.cache_path.




Thanks for your reply.
I have set both cookie storage path [CefCookieManager::SetStoragePath] and the cache path in CefSettings.cache_path,But none of them works.
After I Restart the browser,it still can't log on autoly
wuzebin55
Techie
 
Posts: 17
Joined: Thu Feb 05, 2015 7:05 am

Re: How to implement auto log on in a simple CEF3 Browser

Postby wuzebin55 » Thu Feb 05, 2015 9:22 pm

magreenblatt wrote:Are you running multiple CEF browser processes at the same time, or do you just want to persist the data past shutdown/restart? If the former then you'll need to store the information externally -- in a file that your application writes, for example. If the latter then you can use cookies or localStorage from the JavaScript application and persist the data to disk by specifying a cache path value via CefSettings.cache_path.



Maybe i was wrong,it dose work for some websites.
I may check the web code
wuzebin55
Techie
 
Posts: 17
Joined: Thu Feb 05, 2015 7:05 am

Re: How to implement auto log on in a simple CEF3 Browser

Postby wuzebin55 » Tue Feb 10, 2015 9:03 am

well,finaly I found a easy setting at the begging with persis_cookie_sesstion will solve my problem.

but there is another problem remain.

cookies didn't update when i reload the page.

it still remain the value I start the browser.

I need to restart it to update the cookie values

may someone show me a right way to update the cookies just reload page but not restart the browser?
wuzebin55
Techie
 
Posts: 17
Joined: Thu Feb 05, 2015 7:05 am

Re: How to implement auto log on in a simple CEF3 Browser

Postby magreenblatt » Tue Feb 10, 2015 11:52 am

How are you setting the cookies currently?
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: How to implement auto log on in a simple CEF3 Browser

Postby wuzebin55 » Tue Feb 10, 2015 8:45 pm

magreenblatt wrote:How are you setting the cookies currently?



speicy the path of cache by settings.cache_path

persist_session_cookies set 1

flushstore at [onloadstart]
wuzebin55
Techie
 
Posts: 17
Joined: Thu Feb 05, 2015 7:05 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 22 guests