Table of Contents

Interface ICookieStore

Namespace
DotNetBrowser.Cookies
Assembly
DotNetBrowser.dll

The system for storing and retrieving cookies. The cookies can be stored in the process memory (session cookies) or in files (persistent cookies). The ICookieStore instance provides access to both session and persistent cookies.

public interface ICookieStore : IAutoDisposable
Inherited Members

Remarks

The persistent cookies are stored in the Browser cache directory.

So, if Browser A and B have the same cache directory, then they will access the cookies of each other.

If you need to configure each Browser to use unique cookie storage which is not accessible for other Browser instances, you need to provide unique user data directory for each Browser instance. The user data directory path can be provided via configured UserDataDirectory object that must be passed into the EngineFactory.Create method.

Properties

Engine

Gets the IEngine instance associated with this object.

Profile

Gets the IProfile instance associated with this object.

Methods

Delete(Cookie)

Deletes one specific cookie. The cookie instance can be received from a list of cookies returned from the GetAllCookies(string) method.

DeleteAllCookies()

Deletes all of the cookies including session, secure or HTTP only cookies.

Flush()

Use this method to save all the changes you apply to this cookie storage. By default all the changes to the cookie store are made in memory, so when you restart the application you will not see the changes you made if you don't invoke this method on application exit. You can invoke this method after every change you made to cookie storage.

GetAllCookies(string)

Returns all the cookies for given url including HTTP only cookies.

SetCookie(Cookie)

Sets a session cookie given explicit user-provided cookie attributes.