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
EnvId
The environment id.
public string EnvId { get; }
Property Value
StorePath
The file persistent cookies live in, or null for memory only.
public string? StorePath { get; }
Property Value
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
uriUrisetCookieHeadersIEnumerable<string>
Clear()
Remove every cookie; the count removed.
public int Clear()
Returns
ClearDomain(string)
Remove every cookie of domain (and its subdomains' cookies scoped to it); the count removed.
public int ClearDomain(string domain)
Parameters
domainstring
Returns
CookieHeaderFor(Uri)
The Cookie header for a request to uri.
public string CookieHeaderFor(Uri uri)
Parameters
uriUri
Returns
Observe(Uri, HttpResponseMessage)
Record what a response set after a handler stored it in Container itself.
public void Observe(Uri uri, HttpResponseMessage response)
Parameters
uriUriresponseHttpResponseMessage
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
Returns
Set(CookieSnapshot)
Add a cookie or replace the one with the same domain, path and name.
public void Set(CookieSnapshot cookie)
Parameters
cookieCookieSnapshot
Snapshot()
The cookies still valid, sorted by domain, path and name.
public IReadOnlyList<CookieSnapshot> Snapshot()