# Cookie

## Creating a Cookie

TestMace allows you to manage host's cookies. Click on the Cookie button at the top menu to open the modal for managing cookies. You'll see a list of all existing records. Click the Add button to create a new one and fill in the following fields:

|   Field type  | Purpose                                                                                                                        |
| :-----------: | ------------------------------------------------------------------------------------------------------------------------------ |
|    **Key**    | The cookie name                                                                                                                |
|   **Value**   | The cookie value                                                                                                               |
|   **Domain**  | Sets the cookie domain                                                                                                         |
|    **Path**   | Sets the cookie path                                                                                                           |
|  **Expires**  | Sets the date the cookie will expire. The date format should be able to return the `toGMTString()` method of the `Date` object |
|   **Secure**  | The checked Secure box means that SSL is used to send the cookie to the server                                                 |
| **Http only** | Forbids any JavaScript access to the cookie.                                                                                   |

You can also create a cookie from a row string like this:

`isLogged=1; Expires=31/12/2019 00:00:00; Domain=testmace-stage.herokuapp.com; Path=/posts/; Secure;`

![Creating a Cookie](https://1550208191-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LgbT475LBwT9rFHt0TK%2F-LgfYRYJEPKgk_EHce0O%2Fcookie-1.jpg?alt=media\&token=16e3b4e6-f9ad-4400-a774-c02dcbe4ad9c)

## Editing a Cookie

Will be available in the next release of Testmace.

## Deleting a Cookie

Open the managing cookie window and click on the close icon on the right of the chosen cookie.

![Deleting a Cookie](https://1550208191-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LgbT475LBwT9rFHt0TK%2F-Lgfa14IctOJbbL4MsJ0%2Fdelete_cookie.jpg?alt=media\&token=ecb49ea8-3261-4bbf-8a96-1edbdfd684d1)
