## CookieContainer::Add(System::SharedPtr\<Cookie\>) method


Adds a cookie to the collection.

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Cookie> cookie)
```


| Parameter | Type | Description |
| --- | --- | --- |
| cookie | System::SharedPtr\<Cookie\> | The cookie to add. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.PDF for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Cookie\>, bool) method


Adds a cookie to the collection.

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Cookie> cookie, bool throwOnError)
```


| Parameter | Type | Description |
| --- | --- | --- |
| cookie | System::SharedPtr\<Cookie\> | The cookie to add. |
| throwOnError | bool | A value that indicates if an exception will be thrown when an error occurs. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.PDF for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<CookieCollection\>) method


Copies cookies from the specified collection to the current one.

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<CookieCollection> cookies)
```


| Parameter | Type | Description |
| --- | --- | --- |
| cookies | System::SharedPtr\<CookieCollection\> | The collection from which cookies will be copied. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [CookieCollection](../../cookiecollection/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.PDF for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Uri\>, System::SharedPtr\<Cookie\>) method


Adds a cookie for the specified URI.

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Uri> uri, System::SharedPtr<Cookie> cookie)
```


| Parameter | Type | Description |
| --- | --- | --- |
| uri | System::SharedPtr\<Uri\> | An URI of the cookie. |
| cookie | System::SharedPtr\<Cookie\> | The cookie to add. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Uri](../../../system/uri/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.PDF for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Uri\>, System::SharedPtr\<CookieCollection\>) method


Copies cookies from the specified collection for the specified URI to the current collection.

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Uri> uri, System::SharedPtr<CookieCollection> cookies)
```


| Parameter | Type | Description |
| --- | --- | --- |
| uri | System::SharedPtr\<Uri\> | An URI of the cookie. |
| cookies | System::SharedPtr\<CookieCollection\> | A cookie collection from which cookies must be copied. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Uri](../../../system/uri/)
* Class [CookieCollection](../../cookiecollection/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.PDF for C++](../../../)
