Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​AspNetCore.​Authentication.​Cookies.​ChunkingCookieManager
Assembly: Microsoft.AspNetCore.Authentication.Cookies
Inheritance: object → ChunkingCookieManager
Implemented Interfaces
This handles cookies that are limited by per cookie length. It breaks down long cookies for responses, and reassembles them from requests.
Fields and Constants
public const
int
DefaultChunkSize
The default maximum size of characters in a cookie to send back to the client.
Properties
public
int?
ChunkSize
The maximum size of cookie to send back to the client. If a cookie exceeds this size it will be broken down into multiple
cookies. Set this value to null to disable this behavior. The default is 4050 characters, which is supported by all
common browsers.
Note that browsers may also have limits on the total size of all cookies per domain, and on the number of cookies per domain.
public
bool
ThrowForPartialCookies
Throw if not all chunks of a cookie are available on a request for re-assembly.
Methods
public
string
GetRequestCookie​(Http.​HttpContext context,
string key)
Get the reassembled cookie. Non chunked cookies are returned normally.
Cookies with missing chunks just have their "chunks-XX" header returned.
Returns The reassembled cookie, if any, or null.
public
void
AppendResponseCookie​(Http.​HttpContext context,
string key,
string value,
Http.​CookieOptions options)
Appends a new response cookie to the Set-Cookie header. If the cookie is larger than the given size limit
then it will be broken down into multiple cookies as follows:
Set-Cookie: CookieName=chunks-3; path=/
Set-Cookie: CookieNameC1=Segment1; path=/
Set-Cookie: CookieNameC2=Segment2; path=/
Set-Cookie: CookieNameC3=Segment3; path=/
public
void
DeleteCookie​(Http.​HttpContext context,
string key,
Http.​CookieOptions options)
Deletes the cookie with the given key by setting an expired state. If a matching chunked cookie exists on
the request, delete each chunk.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object