# Class: Cookie

## helma.Http.Cookie(name, value)

Instances of this object represent a HTTP cookie

## Constructor

#### new Cookie(name, value)

Creates a new instance of helma.Http.Cookie

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | The name of the cookie
`value` | String | The value of the cookie

Source:
  - helma/Http.js, line 724

##### Returns:

A newly created Cookie instance

### Members

#### domain :String

An optional domain where this cookie is valid

##### Type:

- String

Source:
  - helma/Http.js, line 753

#### expires :Date

An optional date defining the lifetime of this cookie

##### Type:

- Date

Source:
  - helma/Http.js, line 741

#### name :String

The name of the Cookie

##### Type:

- String

Source:
  - helma/Http.js, line 729

#### path :String

An optional path where this cookie is valid

##### Type:

- String

Source:
  - helma/Http.js, line 747

#### value :String

The value of the Cookie

##### Type:

- String

Source:
  - helma/Http.js, line 735

#### (static, readonly) DATEFORMAT :java.text.SimpleDateFormat

An instance of java.text.SimpleDateFormat used for both parsing an "expires" string into a date and vice versa

##### Type:

- java.text.SimpleDateFormat

Source:
  - helma/Http.js, line 764

#### (static, readonly) PATTERN :RegExp

A regular expression used for parsing cookie strings

##### Type:

- RegExp

Source:
  - helma/Http.js, line 772

### Methods

#### getFieldValue()

Returns this cookie in a format useable to set the HTTP header field "Cookie"

Source:
  - helma/Http.js, line 816

##### Returns:

This cookie formatted as HTTP header field value

#### (static) parse(cookieStr)

Parses the cookie string passed as argument into an instance of helma.Http

##### Parameters:

Name | Type | Description
--- | --- | ---
`cookieStr` | String | The cookie string as received from the remote server

Source:
  - helma/Http.js, line 781

##### Returns:

An instance of helma.Http.Cookie containing the cookie parameters