I'm new to CefSharp. Last week i build my first little program with CefSharp in C#. It's a split screen program. In one split i loaded Tweetdeck. It works fine, but Tweetdeck doesn't store cookies. Every time i start the program, i must login. Is there a way to save the cookies?
var browser1 = new CefSharp.WinForms.ChromiumWebBrowser("https://tweetdeck.twitter.com/")
{
Dock = DockStyle.Fill,
};
splitContainer1.Panel1.Controls.Add(browser1);
To add CefSharp, go to the Solution Explorer on the Top Right of Visual Studio, then right click on your app (under the solution) and select Manage NuGet Packages. When the search menu appears, type cefsharp , select the WinForms distributtion and install it. Follow the installation setup (accept therms and install).
Set CefSettings.CachePath directory. Settings are passed to Cef.Initialize().
just on how to use it.
public partial class MainWindow : Window
{
public MainWindow()
{
CefSharp.CefSettings settings = new CefSharp.CefSettings();
settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF";
CefSharp.Cef.Initialize(settings);
InitializeComponent();
//webcontrol.BrowserSettings.ApplicationCache = CefSharp.CefState.Enabled;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With