C#

using DotNetBrowser;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/**
 * By default all Browser instances with same BrowserContext share
 * cookies and cache data. This sample demonstrates how to create two isolated
 * Browser instances that don't share cookies and cache data.
 */
namespace BrowserContextSample
{
    class Program
    {
        static void Main(string[] args)
        {
            // This Browser instance will store cookies and user data files in "user-data-dir-one" dir.

            String browserOneUserDataDir = Path.GetFullPath("user-data-dir-one");
            Directory.CreateDirectory(browserOneUserDataDir);
            Browser browserOne = BrowserFactory.Create(new BrowserContext(new BrowserContextParams(browserOneUserDataDir)));

            // This Browser instance will store cookies and user data files in "user-data-dir-two" dir.
            String browserTwoUserDataDir = Path.GetFullPath("user-data-dir-two");
            Directory.CreateDirectory(browserTwoUserDataDir);
            Browser browserTwo = BrowserFactory.Create(new BrowserContext(new BrowserContextParams(browserTwoUserDataDir)));

            // The browserOne and browserTwo will not see the cookies and cache data files of each other.
        }
    }
}

VB.NET

Imports DotNetBrowser
Imports System.IO

' By default all Browser instances with same BrowserContext share
' cookies and cache data. This sample demonstrates how to create two isolated
' Browser instances that don't share cookies and cache data.

Module BrowserContextSample
    Sub Main(ByVal args As String())

        'This Browser instance will store cookies and user data files in "user-data-dir-one" dir
        Dim browserOneUserDataDir As String = Path.GetFullPath("user-data-dir-one")
        Directory.CreateDirectory(browserOneUserDataDir)
        Dim browserOne As Browser =
                BrowserFactory.Create(New BrowserContext(New BrowserContextParams(browserOneUserDataDir)))

        'This Browser instance will store cookies and user data files in "user-data-dir-two" dir.
        Dim browserTwoUserDataDir As String = Path.GetFullPath("user-data-dir-two")
        Directory.CreateDirectory(browserTwoUserDataDir)
        Dim browserTwo As Browser =
                BrowserFactory.Create(New BrowserContext(New BrowserContextParams(browserTwoUserDataDir)))

        'The browserOne and browserTwo will not see the cookies and cache data files of each other.
    End Sub
End Module


Make sure that you don't use several BrowserContext instances configured to use same data directory.  In this case Chromium engine will read/write same data directory from different Browser instances which might cause unexpected behavior or errors.