Delphi Chromium Embedded - Create and get a cookie

强颜欢笑 提交于 2019-12-12 03:57:39

问题


I'm using Delphi Chromium Embedded in my application. I should need to save user's account info in a cookie. I know there's CefCookieManager to do it, but i'm not able to find the right procedure to store and to get cookie's value.


回答1:


Uses 
  ceflib;


const
DefaultCookiesDir = 'Cookies/';

implementation
{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
var
  CookieManager: ICefCookieManager;
  CookiesPath : String;
begin
  CookiesPath := ExtractFilePath(Application.ExeName) + DefaultCookiesDir + 'User1';
  CookieManager := TCefCookieManagerRef.GetGlobalManager;
  CookieManager.SetStoragePath(CookiesPath);
  Chromium1.Load('www.vk.com');
end;


来源:https://stackoverflow.com/questions/16086160/delphi-chromium-embedded-create-and-get-a-cookie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!