Object built-in object

Object HttpCookie

http Cookie object, used to add and process cookies

Inheritance

Constructor

HttpCookie

HttpCookie constructor to create a new HttpCookie object

1
new HttpCookie(Object opts = {});

Call parameters:

  • opts : Object, specify the properties of the created cookie

HttpCookie constructor to create a new HttpCookie object

1 2 3
new HttpCookie(String name, String value, Object opts = {});

Call parameters:

  • name : String, specify the name of the cookie created
  • value : String, specify the value of the cookie created
  • opts : Object, specify other attributes of the created cookie

Member attributes

name

String, query and set cookie name

1
String HttpCookie.name;

value

String, query and set cookie value

1
String HttpCookie.value;

domain

String, query and set cookie domain name range

1
String HttpCookie.domain;

path

String, query and set cookie path range

1
String HttpCookie.path;

expires

Date, query and set the expiration time of the cookie

1
Date HttpCookie.expires;

httpOnly

Boolean, query and set cookie whether only http request is allowed, default false

1
Boolean HttpCookie.httpOnly;

secure

Boolean, query and set whether the cookie is only passed through https, the default is false

1
Boolean HttpCookie.secure;

Member function

parse

Parse the given string and fill the cookie object

1
HttpCookie.parse(String header);

Call parameters:

  • header : String, specify the header string to be parsed

match

Check if the given url matches the current setting

1
Boolean HttpCookie.match(String url);

Call parameters:

  • url : String, specify the test url

Return result:

  • Boolean , return true if the match is successful

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String HttpCookie.toString();

Return result:

  • String , returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value HttpCookie.toJSON(String key = "");

Call parameters:

  • key : String, unused

Return result:

  • Value , returns a value containing JSON serializable