Main Content

convert

Class: matlab.net.http.field.SetCookieField
Namespace: matlab.net.http.field

Returns CookieInfo object for each Set-Cookie field

Syntax

value = convert(fields)
value = convert(fields,uri)

Description

value = convert(fields) returns a CookieInfo object for each Set-Cookie field. A SetCookieField contains information about one cookie. If the server sends multiple cookies, then there are multiple SetCookieField objects.

value = convert(fields,uri) compares uri against or initializes the CookieInfo.Domain property.

Input Arguments

expand all

Set-Cookie header field, specified as a matlab.net.http.field.SetCookieField object.

URI, specified as a matlab.net.URI object. The URI is that of the request, used to compare against or initialize the CookieInfo.Domain property.

If the SetCookieField does not contain a Domain attribute, then the CookieInfo.Domain property is set to the URI.Host property.

If there is a Domain attribute, its value must domain-match the URI.Host or no CookieInfo is returned for that SetCookieField. If it matches, then the Domain property is set to the Domain attribute. For information on domain matching, see RFC 6265, section 5.1.3 Domain Matching and section 5.3, Storage Model step 6 on the Internet Engineering Task Force (IETF®) website.

If you do not specify a URI, then the CookieInfo.Domain property is not set or checked. Use this syntax if you do not intend to use the Domain attribute to manage your cookie store.

Output Arguments

expand all

CookieInfo object, returned as a vector of matlab.net.http.CookieInfo objects corresponding to the Set-Cookie fields in the fields vector.

Version History

Introduced in R2016b