org.springframework.http

Class HttpCookie

  • java.lang.Object
    • org.springframework.http.HttpCookie
  • Direct Known Subclasses:
    ResponseCookie


    public class HttpCookie
    extends java.lang.Object
    Represents an HTTP cookie as a name-value pair consistent with the content of the "Cookie" request header. The ResponseCookie sub-class has the additional attributes expected in the "Set-Cookie" response header.
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    See Also:
    RFC 6265
    • Constructor Summary

      Constructors 
      Constructor and Description
      HttpCookie(java.lang.String name, java.lang.String value) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other) 
      java.lang.String getName()
      Return the cookie name.
      java.lang.String getValue()
      Return the cookie value or an empty string (never null).
      int hashCode() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HttpCookie

        public HttpCookie(java.lang.String name,
                          @Nullable
                          java.lang.String value)
    • Method Detail

      • getName

        public java.lang.String getName()
        Return the cookie name.
      • getValue

        public java.lang.String getValue()
        Return the cookie value or an empty string (never null).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object