Click or drag to resize

ICookieStore Interface

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.

Namespace:  DotNetBrowser.Cookies
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.13.0
Syntax
C#
public interface ICookieStore : IAutoDisposable

The ICookieStore type exposes the following members.

Properties
  NameDescription
Public propertyEngine
Gets the IEngine instance associated with this object.
Public propertyIsDisposed
Indicates if the object is already disposed.
(Inherited from IAutoDisposable.)
Public propertyProfile
Gets the IProfile instance associated with this object.
Top
Methods
  NameDescription
Public methodDelete
Deletes one specific cookie. The cookie instance can be received from a list of cookies returned from the GetAllCookies(String) method.
Public methodDeleteAllCookies
Deletes all of the cookies including session, secure or HTTP only cookies.
Public methodFlush
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.
Public methodGetAllCookies
Returns all the cookies for given url including HTTP only cookies.
Public methodSetCookie
Sets a session cookie given explicit user-provided cookie attributes.
Top
Events
  NameDescription
Public eventDisposed
Occurs when the object has been disposed.
(Inherited from IAutoDisposable.)
Top
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.

See Also