Returns the currently configured cookies, in an unmodifiable set. If disabled, this returns an empty set. @return the currently configured cookies, in an unmodifiable set
()
| 72 | * @return the currently configured cookies, in an unmodifiable set |
| 73 | */ |
| 74 | public synchronized Set<Cookie> getCookies() { |
| 75 | if (!isCookiesEnabled()) { |
| 76 | return Collections.emptySet(); |
| 77 | } |
| 78 | |
| 79 | final Set<Cookie> copy = new LinkedHashSet<>(cookies_); |
| 80 | return Collections.unmodifiableSet(copy); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Clears all cookies that have expired before supplied date. |