Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSHTTPCookieStorageMBS class.
NSHTTPCookieStorageMBS.Constructor Private
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSHTTPCookieStorageMBS.cookieAcceptPolicy as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The default cookie accept policy is NSHTTPCookieAcceptPolicyAlways.
Changing the cookie policy affects all currently running applications using the cookie storage.
(Read and Write computed property)
NSHTTPCookieStorageMBS.cookies as NSHTTPCookieMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array containing all of the cookie storage's cookies.
NSHTTPCookieStorageMBS.cookiesForURL(URL as string) as NSHTTPCookieMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An application can use NSHTTPCookie method requestHeaderFieldsWithCookies to turn this array into a set of header fields to add to an NSMutableURLRequest object.
NSHTTPCookieStorageMBS.cookiesToArray(cookies() as NSHTTPCookieMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 16.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns total number of cookies.
This is for Xojo 2007 where the cookies function doesn't work.
For Xojo and Xojo you can use cookies function.
NSHTTPCookieStorageMBS.deleteCookie(cookie as NSHTTPCookieMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSHTTPCookieStorageMBS.removeCookiesSinceDate(d as date)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 17.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Available on macOS 10.10 or newer.
See also:
NSHTTPCookieStorageMBS.removeCookiesSinceDate(d as dateTime)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 20.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Available on macOS 10.10 or newer.
See also:
NSHTTPCookieStorageMBS.setCookie(cookie as NSHTTPCookieMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The cookie replaces an existing cookie with the same name, domain, and path, if one exists in the cookie storage. This method accepts the cookie only if the receiver's cookie accept policy is NSHTTPCookieAcceptPolicyAlways or NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain. The cookie is ignored if the receiver's cookie accept policy is NSHTTPCookieAcceptPolicyNever.
NSHTTPCookieStorageMBS.setCookies(cookies() as NSHTTPCookieMBS, URL as string, mainDocumentURL as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Networking | MBS MacControls Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
cookies: The cookies to add.
URL: The URL associated with the added cookies.
mainDocumentURL: The URL of the main HTML document for the top-level frame, if known. Can be "". This URL is used to determine if the cookie should be accepted if the cookie accept policy is NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain.
The cookies will replace existing cookies with the same name, domain, and path, if one exists in the cookie storage. The cookie will be ignored if the receiver's cookie accept policy is NSHTTPCookieAcceptPolicyNever.
To store cookies from a set of response headers, an application can use cookiesWithResponseHeaderFields passing a header field dictionary and then use this method to store the resulting cookies in accordance with the receiver's cookie acceptance policy.
The items on this page are in the following plugins: MBS MacControls Plugin.