Back to product page

Attributes property


Holds cookie attributes

Type

A HttpHeaders object.

Syntax

  • Basic
object.Attributes
The Attributes(object) syntax has these parts:
objectAn expression evaluating to an object of type HttpCookie.

Remarks

This method will return reference to all attributes for the cookie. For example, you may receive something like this from the server (in response headers):

Set-Cookie: BrowserTest=Success?; domain=.some.com;path=/;HTTPOnly= ;version=1
Set-Cookie: PResult=1074395041&co=1&id=2

in which case there are 2 cookies: one with name 'BrowserTest' and another with name 'PRresult'. Since attributes are separated with semicolon, this means that first cookie has 4 attributes: domain, path, HTTPOnly and version. When cookie is to be returned in next request, you don't need to send cookie attributes, but perhaps you might want to check them if they apply for next request.

For example, if there is 'Expires' attribute, then perhaps you don't need to send cookie - because date provided in the cookie already expired?

Or, if there's 'Path' attribute, and you don't request same location - you don't need to send the cookie.

Attributes are kept in HttpHeaders object - since this object is good enough to hold 'name/value' pairs, even it's primary purpose is to store headers (as the name says).

Platforms

Windows