---
title: "sharedCookieStorage(forGroupContainerIdentifier:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/httpcookiestorage/sharedcookiestorage(forgroupcontaineridentifier:)"
---

# sharedCookieStorage(forGroupContainerIdentifier:)

Returns the cookie storage instance for the container associated with the specified app group identifier.

## Declaration

```swift
class func sharedCookieStorage(forGroupContainerIdentifier identifier: String) -> HTTPCookieStorage
```

## Parameters

- `identifier`: The app group identifier.

## Discussion

Discussion By default, apps and associated app extensions will have different data containers. As a result, the value of the HTTPCookieStorage class’s shared property will refer to different persistent cookie stores when called by the app and by its extensions.You can use this method to create a persistent cookie storage available to all apps and extensions with access to the same app group. Subsequent calls to the this method with the same identifier will return the same storage instance.

## See Also

### Getting the shared cookie storage object

- [shared](foundation/httpcookiestorage/shared.md)
