Package org.forgerock.openig.cookie
Class SplitCookieService
java.lang.Object
org.forgerock.openig.cookie.SplitCookieService
Split a target cookie that is bigger than 4Kb (see RFC
6265) into smaller cookies.
If the tracked cookie is too big, it is replaced by several cookies named [originalCookieName][partNumber].
If a tracked split cookie is found in a request, it is reassembled transparently.
If the cookie name maps multiple cookies, only the first one will be taken into account.
For example, if the tracked cookie is named "myCookie" and is 10Kb long, then it will be split into 3 cookies named : "myCookie0", "myCookie1" and "myCookie2", the 2 first weighting 4Kb and the last 2Kb.
-
Constructor Summary
ConstructorDescriptionSplitCookieService
(String cookieName) Create a newSplitCookieService
that will split/assemble the cookie with the given name. -
Method Summary
Modifier and TypeMethodDescriptionint
assembleSplitRequestCookies
(Headers requestHeaders) Assemble the split cookies into a single cookie (if any).void
splitResponseCookie
(int previousPartCount, Headers responseHeaders) Split the response cookie if it is too big.
-
Constructor Details
-
SplitCookieService
Create a newSplitCookieService
that will split/assemble the cookie with the given name.- Parameters:
cookieName
- the name of the cookie to split/assemble
-
-
Method Details
-
assembleSplitRequestCookies
Assemble the split cookies into a single cookie (if any).- Parameters:
requestHeaders
- the request headers- Returns:
- the number of parts gathered
-
splitResponseCookie
Split the response cookie if it is too big.- Parameters:
previousPartCount
- the number of parts gathered in the requestresponseHeaders
- the response headers
-