MCPcopy Index your code
hub / github.com/apache/tomcat / CookieProcessorBase

Class CookieProcessorBase

java/org/apache/tomcat/util/http/CookieProcessorBase.java:28–141  ·  view source on GitHub ↗

Base implementation of CookieProcessor.

Source from the content-addressed store, hash-verified

26 * Base implementation of {@link CookieProcessor}.
27 */
28public abstract class CookieProcessorBase implements CookieProcessor {
29
30 /**
31 * Default constructor.
32 */
33 public CookieProcessorBase() {
34 }
35
36 private static final String COOKIE_DATE_PATTERN = "EEE, dd MMM yyyy HH:mm:ss z";
37
38 /**
39 * Thread-local date format for cookie dates.
40 */
41 protected static final ThreadLocal<DateFormat> COOKIE_DATE_FORMAT = ThreadLocal.withInitial(() -> {
42 DateFormat df = new SimpleDateFormat(COOKIE_DATE_PATTERN, Locale.US);
43 df.setTimeZone(TimeZone.getTimeZone("GMT"));
44 return df;
45 });
46
47 /**
48 * A date far in the past used to expire cookies.
49 */
50 protected static final String ANCIENT_DATE;
51
52 static {
53 ANCIENT_DATE = COOKIE_DATE_FORMAT.get().format(new Date(10000));
54 }
55
56 private SameSiteCookies sameSiteCookies = SameSiteCookies.UNSET;
57
58 private boolean partitioned = false;
59
60 private CookiesWithoutEquals cookiesWithoutEquals = CookiesWithoutEquals.NAME;
61
62
63 /**
64 * Get the current cookiesWithoutEquals setting as a string.
65 *
66 * @return The cookiesWithoutEquals value
67 */
68 public String getCookiesWithoutEquals() {
69 return cookiesWithoutEquals.getValue();
70 }
71
72
73 /**
74 * Get the current cookiesWithoutEquals setting as an enum.
75 *
76 * @return The cookiesWithoutEquals value
77 */
78 protected CookiesWithoutEquals getCookiesWithoutEqualsInternal() {
79 return cookiesWithoutEquals;
80 }
81
82
83 /**
84 * Set the cookiesWithoutEquals setting.
85 *

Callers

nothing calls this directly

Calls 4

setTimeZoneMethod · 0.80
getTimeZoneMethod · 0.80
formatMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected