Class CookieHandler


  • public class CookieHandler
    extends Object
    Creates and converts cookies.
    Author:
    Ulli Hafner
    • Constructor Detail

      • CookieHandler

        public CookieHandler​(String name)
        Creates a new instance of CookieHandler.
        Parameters:
        name - the name of the cookie
    • Method Detail

      • create

        public javax.servlet.http.Cookie create​(List<org.kohsuke.stapler.Ancestor> requestAncestors,
                                                String value)
        Sends a cookie with the specified value.
        Parameters:
        requestAncestors - the ancestors of the request
        value - the cookie value
        Returns:
        the created cookie
      • getValue

        public String getValue​(javax.servlet.http.Cookie[] cookies)
        Selects the correct cookie from the specified cookies and returns its value. If there is no such cookie, then an empty string is returned.
        Parameters:
        cookies - the cookies to scan
        Returns:
        the cookie value or an empty string if the cookie is not found