<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/HTTPCookieStorage/sharedCookieStorage(forGroupContainerIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSHTTPCookieStorage(cm)sharedCookieStorageForGroupContainerIdentifier:"
  },
  "title" : "sharedCookieStorage(forGroupContainerIdentifier:)"
}
-->

# sharedCookieStorage(forGroupContainerIdentifier:)

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

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

## Parameters

`identifier`

The app group identifier.

## Discussion

By default, apps and associated app extensions will have different data containers. As a result, the value of the [`HTTPCookieStorage`](/documentation/Foundation/HTTPCookieStorage) class’s [`shared`](/documentation/Foundation/HTTPCookieStorage/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)