CEF3相关的一些参考文档

win10 

vs2010 32位的

 

下载cef代码,然后编译库

https://www.cnblogs.com/honfu/p/11478785.html

https://blog.csdn.net/lengyue2015/article/details/77972035

 

win32工程嵌入cef3

https://blog.csdn.net/lengyue2015/article/details/80807881

遇到的问题 https://docs.microsoft.com/zh-cn/windows/win32/sysinfo/targeting-your-application-at-windows-8-1?redirectedfrom=MSDN

 

使用cookie实现自动登录功能

他的cefsimple这个demo是,默认的是没有cookie自动登录的。

只需要设置一下cache目录就可以了

demo中,就是在启动函数中设置一下 settings.root_cache_path 和 settings.cache_path

代码如下:

  char szSubExePath[MAX_PATH];
  PathCombineA(szSubExePath, szExeFullPath, "cef\\cache");
  char szRootExePath[MAX_PATH];
  PathCombineA(szRootExePath, szExeFullPath, "cef");
  CefString(&settings.root_cache_path).FromASCII(szRootExePath);
  CefString(&settings.cache_path).FromASCII(szSubExePath)

 

ps:关于cookies:

大多数需要登录的网站用户验证成功之后都会设置一个 cookie,只要这个 cookie 存在并可以,用户就可以自由浏览这个网站的任意页面

这个cookie 就是浏览器储存用户电脑上的一小段文本文件。是纯文本格式,不包含任何可执行的代码。

一个 Web 页面或服务器来告知浏览器按照一定规范储存这些信息,并在随后的请求中将这些信息发送至服务器,Web 服务器就可以使用这些信息来识别不同的用户。

 

ps:可能要以后有用的参考资料:

https://blog.csdn.net/lee353086/article/details/42970909?_t_t_t=0.22884619049948474  这个估计是自己设置cookie?但是也可以不自己设置,上面只要设置了root就自己设置了?

https://www.cnblogs.com/chechen/p/10286465.html CEF3中,CefCookieManager这个类就是用来管理cookies的。相关的函数有:https://magpcss.org/ceforum/apidocs3/projects/(default)/CefCookieManager.html 也可以直接看代码中的注释。

Method Summary
 static CefRefPtr< CefCookieManager >CreateManager( const CefString& path, bool persist_session_cookies, CefRefPtrCefCompletionCallback > callback ) 
          Creates a new cookie manager.
 virtual boolDeleteCookies( const CefString& url, const CefString& cookie_name, CefRefPtrCefDeleteCookiesCallback > callback )= 0 
          Delete all cookies that match the specified parameters.
 virtual boolFlushStoreCefRefPtrCefCompletionCallback > callback )= 0 
          Flush the backing store (if any) to disk.
 static CefRefPtr< CefCookieManager >GetGlobalManagerCefRefPtrCefCompletionCallback > callback ) 
          Returns the global cookie manager.
 virtual boolSetCookie( const CefString& url, const CefCookie& cookie, CefRefPtrCefSetCookieCallback > callback )= 0 
          Sets a cookie given a valid URL and explicit user-provided cookie attributes.
 virtual boolSetStoragePath( const CefString& path, bool persist_session_cookies, CefRefPtrCefCompletionCallback > callback )= 0 
          Sets the directory path that will be used for storing cookie data.
 virtual voidSetSupportedSchemes( const std::vector< CefString >& schemes, CefRefPtrCefCompletionCallback > callback )= 0 
          Set the schemes supported by this manager.
 virtual boolVisitAllCookiesCefRefPtrCefCookieVisitor > visitor )= 0 
          Visit all cookies on the IO thread.
 virtual boolVisitUrlCookies( const CefString& url, bool includeHttpOnly, CefRefPtrCefCookieVisitor > visitor )= 0 
          Visit a subset of cookies on the IO thread.

 

https://www.cnblogs.com/llguanli/p/7198637.html 通过CefPostTask接口,进行设置和删除

CefPostTask(TID_IO, NewCefRunnableMethod(manager.get(), &CefCookieManager::SetCookie,CefString(domain.c_str()), cookie));

CefPostTask(TID_IO, NewCefRunnableMethod(manager.get(), &CefCookieManager::DeleteCookies, CefString(domain.c_str()), CefString("username")));

 

https://magpcss.org/ceforum/viewtopic.php?f=6&t=17793&hilit=cookie&start=0

 

CEF 获取Cookie例子 CefCookieManager C++ https://www.cnblogs.com/wcctml/p/6965349.html

https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain

 

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ivy_0709

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值