首页 > 解决方案 > How can I save a WhatsApp session using Delphi and Chromium?

问题描述

I'm using the CEF3 2378.1280 branch and Delphi 10.1. I'm using the following code to save sessions:

var
    CookieManager: ICefCookieManager;

FromCreate:
    CookiesPath := ExtractFilePath(Application.ExeName) + 'cookies';
    CookieManager := TCefCookieManagerRef.Global(nil);
    CookieManager.SetStoragePath(CookiesPath, true, nil);

This code work fine with Facebook and a lot of other sites. But for web.whatsapp.com it can't save the session: After restarting the program, I must do tge QR-code validation again.

How can I save a WhatsApp session?

标签: delphiwhatsappchromium-embedded

解决方案


很抱歉我让你把你的问题移到这里。通常,所有可能与 CEF 绑定有关的问题都被重定向到各自的论坛,这是一个纯 DCEF3 问题。

您不需要指定单独的 cookies 目录。您只需要使用“ CefCache ”变量设置缓存目录。

CEF3 2378.1280 分支太旧,该网站可能不支持它。如果您仍然需要支持 Windows XP 和 Vista,请升级到 CEF3.2623,如果您想要最新的分支,请升级到 CEF3.3440。

如果您决定使用 CEF3.2623 您可以使用DCEF3OldCEF4Delphi。要使用最新的分支,您必须使用CEF4Delphi


推荐阅读