Class NetscapeDraftSpec

    • Constructor Detail

      • NetscapeDraftSpec

        public NetscapeDraftSpec()
        Deprecated.
        Default constructor
    • Method Detail

      • parse

        public Cookie[] parse​(java.lang.String host,
                              int port,
                              java.lang.String path,
                              boolean secure,
                              java.lang.String header)
                       throws MalformedCookieException
        Deprecated.
        Parses the Set-Cookie value into an array of Cookies.

        Syntax of the Set-Cookie HTTP Response Header:

        This is the format a CGI script would use to add to the HTTP headers a new piece of data which is to be stored by the client for later retrieval.

          Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure
         

        Please note that Netscape draft specification does not fully conform to the HTTP header format. Netscape draft does not specify whether multiple cookies may be sent in one header. Hence, comma character may be present in unquoted cookie value or unquoted parameter value.

        Specified by:
        parse in interface CookieSpec
        Overrides:
        parse in class CookieSpecBase
        Parameters:
        host - the host from which the Set-Cookie value was received
        port - the port from which the Set-Cookie value was received
        path - the path from which the Set-Cookie value was received
        secure - true when the Set-Cookie value was received over secure conection
        header - the Set-Cookie received from the server
        Returns:
        an array of Cookies parsed from the Set-Cookie value
        Throws:
        MalformedCookieException - if an exception occurs during parsing
        See Also:
        CookieSpec.validate(String, int, String, boolean, Cookie)
      • domainMatch

        public boolean domainMatch​(java.lang.String host,
                                   java.lang.String domain)
        Deprecated.
        Performs domain-match as described in the Netscape draft.
        Specified by:
        domainMatch in interface CookieSpec
        Overrides:
        domainMatch in class CookieSpecBase
        Parameters:
        host - The target host.
        domain - The cookie domain attribute.
        Returns:
        true if the specified host matches the given domain.
      • validate

        public void validate​(java.lang.String host,
                             int port,
                             java.lang.String path,
                             boolean secure,
                             Cookie cookie)
                      throws MalformedCookieException
        Deprecated.
        Performs Netscape draft compliant Cookie validation
        Specified by:
        validate in interface CookieSpec
        Overrides:
        validate in class CookieSpecBase
        Parameters:
        host - the host from which the Cookie was received
        port - the port from which the Cookie was received
        path - the path from which the Cookie was received
        secure - true when the Cookie was received using a secure connection
        cookie - The cookie to validate.
        Throws:
        MalformedCookieException - if an exception occurs during validation