CEF3设置cookie
#include "CEF3Helper.h"
#include "../include/cef_app.h"
#include "../include/cef_browser.h"
#include "../include/cef_frame.h"
#include "../include/cef_sandbox_win.h"
#include "../include/cef_task.h"
#include "../include/cef_runnable.h" void SetCookie(std::wstring domain, std::wstring key, std::wstring value)
{
CefRefPtr<CefSetCookieCallback> callback = NULL;
CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager(nullptr);
CefCookie cookie;
CefString(&cookie.name).FromWString(key.c_str());
CefString(&cookie.value).FromWString(value.c_str());
CefString(&cookie.domain).FromWString(domain.c_str());//www.magpcss.net//kagula-work-pc
CefString(&cookie.path).FromASCII("/");
cookie.has_expires = true;
cookie.expires.year = ;
cookie.expires.month = ;
cookie.expires.day_of_week = ;
cookie.expires.day_of_month = ; std::wstring httpDomain = L"https://";
httpDomain.append(domain);
CefPostTask(TID_IO, NewCefRunnableMethod(manager.get(), &CefCookieManager::SetCookie, CefString(httpDomain.c_str()), cookie, callback));
}
参考:https://blog.csdn.net/lee353086/article/details/42970909?_t_t_t=0.22884619049948474
CEF3设置cookie的更多相关文章
- CEF 设置Cookie
参考文档:http://magpcss.org/ceforum/apidocs3/projects/(default)/CefCookieManager.html 转载:https://www.cnb ...
- 登陆后设置cookie的方法
public void SetCookie(string userName, string role,string cookieValueName) {FormsAuthentication.Form ...
- Jquery设置Cookie
jQuery代码: <script src="js/jquery-1.3.1.js" type="text/javascript"></scr ...
- 运用JS设置cookie、读取cookie、删除cookie
JavaScript是运行在客户端的脚本,因此一般是不能够设置Session的,因为Session是运行在服务器端的.而cookie是运行在客户端的,所以可以用JS来设置cookie. 假设有这样一种 ...
- JS设置cookie、读取cookie、删除cookie
JS设置cookie.读取cookie.删除cookie JS设置cookie,注意一定要path=/ ,根目录,不然其他目录可能查询不到..默认是本目录. document.cookie ...
- android webview里获取和设置cookie
private class MyWebViewClient extends WebViewClient { public boolean shouldOverrideUrlLoading(WebVie ...
- JS设置cookie
cookie 与 session 是网页开发中常用的信息存储方式.Cookie是在客户端开辟的一块可存储用户信息的地方:Session是在服务器内存中开辟的一块存储用户信息的地方. JavaScrip ...
- js 设置Cookie 在PHP中读取(大师手法)
设置Cookie时要把一个json整体放入Cookie而不是单独放入,影响效率. var Cookies = {}; /** * 设置Cookies */ va ...
- 关于启明星系统移除apppath配置,让系统自动获取路径来设置cookie的解决方法
启明星系统底层使用统一接口,特别是用户,用户登录后,都会建立一个 userinfo 的cookie.请看下面2个网址: http://120.24.86.232/book http://120.24. ...
随机推荐
- Linux的网络不通流程
a:xshell连不上的问题第一步:检查网络适配器,是否禁用vmware的虚拟机网卡第二步:检查vmware net8的地址是否为10.0.0.1第三步:检查系统的vmware服务是否启动第四步:检查 ...
- Python学习日记(十) 生成器和迭代器
使用dir()我们可以知道这个数据类型的内置函数有什么方法: print(dir(int)) print(dir(bool)) print(dir([])) print(dir({})) print( ...
- mysql json字段
从 MySQL 5.7.8 开始,MySQL 支持原生的 JSON 数据类型. 一. 创建json(不可以设置长度,可以是null,不能用有默认值) mysql> CREATE TABLE ...
- RabbitMQ direct交换器
1:队列和交换器多次绑定 String[] routekeys={"routekey1","routekey2","routekey3"}; ...
- PCM音频数据格式介绍
http://blog.csdn.net/ljxt523/article/details/52068241 1. What is PCM? PCM(Pulse-code-modulation)是模拟信 ...
- Linux命令——df
参考:12 Useful “df” Commands to Check Disk Space in Linux 简介 df用于查看文件系统磁盘空间使用情况. df 读取的数据几乎都是针对一整个文件系统 ...
- STM32+IAR 解决Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned
在IAR中编译STM32工程,遇到 Error[Pe147]: declaration is incompatible with "__nounwind __interwork __soft ...
- Integer Inquiry UVA-424(大整数)
题意分析: 将字符串倒着存入int数组中,每次加完后再取余除去大于10的部分 关键:倒着存入,这样会明显缩短代码量. #include<iostream> #include<cstd ...
- 剑指Offer(三十五):数组中的逆序对
剑指Offer(三十五):数组中的逆序对 搜索微信公众号:'AI-ming3526'或者'计算机视觉这件小事' 获取更多算法.机器学习干货 csdn:https://blog.csdn.net/bai ...
- selenium常用的API(一)截屏
我们在使用selenium测试过程中,可使用截屏功能将用例执行失败的画面截图保存,方便测试执行结束后查看并定位问题. 以下介绍两种截屏方法: 对当前浏览器窗口截屏 使用selenium自带的get_s ...