List icon Contents

How to retain cookies and caches

DotNetBrowser stores cookies, cache, history, and other kinds of data in the user data directory.

By default, DotNetBrowser creates this directory when the IEngine starts and removes it when the engine is closed. As a result, the login session, passwords, credit cards, and other data get deleted.

To retain the data, configure the permanent location for the user data directory:

IEngine engine = EngineFactory.Create(new EngineOptions.Builder
{
    UserDataDirectory = @"C:\Users\Me\DotNetBrowser"
}.Build());
Dim engine As IEngine = EngineFactory.Create(New EngineOptions.Builder With 
{
    .UserDataDirectory = "C:\Users\Me\DotNetBrowser"
}.Build())
Go Top