Retrieves the cookie expiration in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.

@param expectedCookieName - the name of the cookie
@return String - the expiration of the cookie
548728
public Date cookieExpiration(String expectedCookieName) {
        Cookie cookie = cookie(expectedCookieName);
        if (cookie != null) {
            return cookie.getExpiry();
        }
        return null;
    }
750333
public String getUnencodedHtmlCookieString(String name, String value) {
        return getUnencodedHtmlCookieString(name, value, null);
    }
850996
public static String getCookieValue(String name, HttpServletRequest request) {
        Cookie cookie = getCookie(name, request);
        if (cookie != null) {
            return cookie.getValue();
        } else {
            return null;
        }
    }
1193747
public static String getCookieValue(ServletRequest request, String key)
	{
		Cookie[] cookies = ((HttpServletRequest) request).getCookies();
		if (cookies != null)
		{
			for (int i = 0; i < cookies.length; i++)
			{
				if (cookies[i].getName().equals(key))
				{
					return cookies[i].getValue();
				}
			}
		}
		return null;
	}
505935
synchronized public static String getOldCookieDate(long time) {

        if (OLD_COOKIE.getTimeZone() != GMT_TIMEZONE) {
            // ensure GMT is used as time zone for the header generation
            OLD_COOKIE.setTimeZone(GMT_TIMEZONE);
        }

        try {
            return OLD_COOKIE.format(new Date(time));
        } catch (Throwable t) {
            return OLD_COOKIE.format(new Date());
        }
    }
1109692
public static String getCookieValue(HttpServletRequest req, String name) {
		if (StringUtils.isBlank(name) || req == null) {
			return null;
		}
		Cookie[] cookies = req.getCookies();
		if (cookies == null) {
			return null;
		}
		//Otherwise, we have to do a linear scan for the cookie.
		for (Cookie cookie : cookies) {
			if (cookie.getName().equals(name)) {
				return cookie.getValue();
			}
		}
		return null;
	}
1185959
public String getCurrentExpireDate() {

        // get the expiration date
        if (isMultiOperation()) {
            return CmsTouch.DEFAULT_DATE_STRING;
        } else {
            try {
                CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION);
                if (res.getDateExpired() == CmsResource.DATE_EXPIRED_DEFAULT) {
                    return CmsTouch.DEFAULT_DATE_STRING;
                } else {
                    return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateExpired());
                }
            } catch (CmsException e) {
                return CmsCalendarWidget.getCalendarLocalizedTime(
                    getLocale(),
                    getMessages(),
                    System.currentTimeMillis());
            }
        }
    }
1252782
public String getCookie(String name) {
		Cookie c = requestCookies.get().get(name);
		return c == null ? null : c.getValue();
	}
405665
public String validateCookieName(String cookieName, boolean quiet) {
		if (cookieName == null || cookieName.length() == 0) {
			if (!quiet) {
				Tr.error(tc, "COOKIE_NAME_CANT_BE_EMPTY");
			}
			return CFG_DEFAULT_COOKIENAME;
		}
		String cookieNameUc = cookieName.toUpperCase();
		boolean valid = true;
		for (int i = 0; i < cookieName.length(); i++) {
			String eval = cookieNameUc.substring(i, i + 1);
			if (!validCookieChars.contains(eval)) {
				if (!quiet) {
					Tr.error(tc, "COOKIE_NAME_INVALID", new Object[] { cookieName, eval });
				}
				valid = false;
			}
		}
		if (!valid) {
			return CFG_DEFAULT_COOKIENAME;
		} else {
			return cookieName;
		}
	}
1276702
public static Expectations jwtCookieExists(String testAction, WebClient webClient, String jwtCookieName) {
        Expectations expectations = new Expectations();
        expectations.addExpectation(new CookieExpectation(testAction, webClient, jwtCookieName, JwtFatConstants.JWT_REGEX, JwtFatConstants.NOT_SECURE, JwtFatConstants.HTTPONLY));
        return expectations;
    }
1253721
protected function getCookieExpirationDate()
	{
		return Config::get( $this->configPrefix . '.expire_on_close' ) ? 0 : Carbon::now()->addMinutes( Config::get( $this->configPrefix . '.lifetime' ) );
	}
650290
private Cookie logInAndObtainCookie(String testName, WebClient webClient, String protectedUrl, String username, String password, String cookieName,
                                        Expectations expectations) throws Exception {
        Page response = invokeProtectedUrlAndValidateResponse(testName, webClient, protectedUrl, expectations);
        doFormLoginAndValidateResponse(response, username, password, expectations);

        Cookie cookie = webClient.getCookieManager().getCookie(cookieName);
        assertNotNull("Cookie [" + cookieName + "] was null but should not have been.", cookie);
        return cookie;
    }
721409
public com.google.protobuf.Duration getDefaultCookieExpiration() {
    return defaultCookieExpiration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : defaultCookieExpiration_;
  }
356152
public static String extractCookie(final HttpServletRequest request, final String name) {
		for (Cookie cookie : request.getCookies()) {
			if (cookie.getName().equals(name)) {
				return cookie.getValue();
			}
		}
		return null;
	}
950499
public Date getExpiry() {
        String dateTime = getFieldValue(SubscribeOptionFields.expire);
        try {
            return XmppDateTime.parseDate(dateTime);
        }
        catch (ParseException e) {
            UnknownFormatConversionException exc = new UnknownFormatConversionException(dateTime);
            exc.initCause(e);
            throw exc;
        }
    }
398995
public Long getCookieToLong(String name) {
		String result = getCookie(name);
		return result != null ? Long.parseLong(result) : null;
	}
312869
public static NewCookie newDeletedCookie(String name) {
        /**
         * Create a new instance.
         *
         * @param name     the name of the cookie
         * @param value    the value of the cookie
         * @param path     the URI path for which the cookie is valid
         * @param domain   the host domain for which the cookie is valid
         * @param version  the version of the specification to which the cookie complies
         * @param comment  the comment
         * @param maxAge   the maximum age of the cookie in seconds
         * @param expiry   the cookie expiry date.
         * @param secure   specifies whether the cookie will only be sent over a secure connection
         * @param httpOnly if {@code true} make the cookie HTTP only, i.e. only visible as part of an HTTP request.
         * @throws IllegalArgumentException if name is {@code null}.
         * @since 2.0
         */
        return new NewCookie(name, DELETED_COOKIE_VALUE, "/", null, Cookie.DEFAULT_VERSION, null, 0, null, false, true);
    }