Class BowireCookieJar

Namespace
Kuestenlogik.Bowire.Auth
Assembly
Kuestenlogik.Bowire.dll

One environment's cookies in one workspace (#681).

public sealed class BowireCookieJar
Inheritance
BowireCookieJar
Inherited Members

Properties

Container

The container that does the matching.

public CookieContainer Container { get; }

Property Value

CookieContainer

EnvId

The environment id.

public string EnvId { get; }

Property Value

string

StorePath

The file persistent cookies live in, or null for memory only.

public string? StorePath { get; }

Property Value

string

Methods

Accept(Uri, IEnumerable<string>)

Take the Set-Cookie headers of a response to uri into the jar, and persist. A header the container rejects (wrong domain, malformed) is dropped, as a browser would.

public void Accept(Uri uri, IEnumerable<string> setCookieHeaders)

Parameters

uri Uri
setCookieHeaders IEnumerable<string>

Clear()

Remove every cookie; the count removed.

public int Clear()

Returns

int

ClearDomain(string)

Remove every cookie of domain (and its subdomains' cookies scoped to it); the count removed.

public int ClearDomain(string domain)

Parameters

domain string

Returns

int

CookieHeaderFor(Uri)

The Cookie header for a request to uri.

public string CookieHeaderFor(Uri uri)

Parameters

uri Uri

Returns

string

Observe(Uri, HttpResponseMessage)

Record what a response set after a handler stored it in Container itself.

public void Observe(Uri uri, HttpResponseMessage response)

Parameters

uri Uri
response HttpResponseMessage

Persist()

Persist what a client library stored in Container on its own (SignalR, a WebSocket handshake), where no response passes through Bowire to Accept(Uri, IEnumerable<string>).

public void Persist()

Remove(string, string, string)

Remove one cookie; true when it existed.

public bool Remove(string domain, string path, string name)

Parameters

domain string
path string
name string

Returns

bool

Set(CookieSnapshot)

Add a cookie or replace the one with the same domain, path and name.

public void Set(CookieSnapshot cookie)

Parameters

cookie CookieSnapshot

Snapshot()

The cookies still valid, sorted by domain, path and name.

public IReadOnlyList<CookieSnapshot> Snapshot()

Returns

IReadOnlyList<CookieSnapshot>