Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSHTTPCookieMBS class.

NSHTTPCookieMBS.comment as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's comment string.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display comment
MsgBox "Comment: "+Cookie.comment

The receiver's comment string or "" if the cookie has no comment. This string is suitable for presentation to the user, explaining the contents and purpose of this cookie.
(Read only property)

NSHTTPCookieMBS.commentURL as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's comment URL.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display comment URL
MsgBox "commentURL: "+Cookie.commentURL

The receiver's comment URL or "" if the cookie has none. This value specifies a URL which is suitable for presentation to the user as a link for further information about this cookie.
(Read only property)

NSHTTPCookieMBS.domain as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the domain of the receiver's cookie.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display domain:
MsgBox "Domain: "+Cookie.Domain

If the domain does not start with a dot, then the cookie is only sent to the exact host specified by the domain. If the domain does start with a dot, then the cookie is sent to other hosts in that domain as well, subject to certain restrictions. See RFC 2965 for more detail.
(Read only property)

NSHTTPCookieMBS.expiresDate as date

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's expiration date.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display date:
MsgBox "Domain: "+Cookie.expiresDate.ShortTime+" "+Cookie.expiresDate.LongTime

The receiver's expiration date, or nil if there is no specific expiration date such as in the case of "session-only" cookies. The expiration date is the date when the cookie should be deleted.
(Read only property)

NSHTTPCookieMBS.expiresDateTime as dateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 20.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's expiration date.

(Read only property)

NSHTTPCookieMBS.Handle 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 internal object reference.

(Read and Write property)

NSHTTPCookieMBS.isHTTPOnly as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns whether the receiver should only be sent to HTTP servers per RFC 2965.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display isHTTPOnly value:
MsgBox "isHTTPOnly: "+str(Cookie.isHTTPOnly)

Returns true if this cookie should only be sent via HTTP headers, false otherwise.

Cookies may be marked as HTTP only by a server (or by a javascript). Cookies marked as such must only be sent via HTTP Headers in HTTP requests for URL's that match both the path and domain of the respective cookies.

Important: Cookies specified as HTTP only should not be delivered to any javascript applications to prevent cross-site scripting vulnerabilities.
(Read only property)

NSHTTPCookieMBS.isSecure as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns whether his cookie should only be sent over secure channels.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display isSecure value:
MsgBox "isSecure: "+str(Cookie.isSecure)

True if this cookie should only be sent over secure channels, otherwise false.
(Read only property)

NSHTTPCookieMBS.isSessionOnly as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns whether the receiver should be discarded at the end of the session (regardless of expiration date).
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display isSessionOnly value:
MsgBox "isSessionOnly: "+str(Cookie.isSessionOnly)

True if the receiver should be discarded at the end of the session (regardless of expiration date), otherwise false.
(Read only property)

NSHTTPCookieMBS.name as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's name.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display name:
MsgBox "name: "+Cookie.name

(Read only property)

NSHTTPCookieMBS.path as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's path.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display path:
MsgBox "path: "+Cookie.path

The cookie will be sent with requests for this path in the cookie's domain, and all paths that have this prefix. A path of "/" means the cookie will be sent for all URLs in the domain.
(Read only property)

NSHTTPCookieMBS.properties as dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's cookie properties.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display properties

dim dic as Dictionary = cookie.properties
dim list(-1) as string

for each key as Variant in dic.keys
List.Append key.StringValue+": "+dic.Value(key).StringValue
next

MsgBox Join(list,EndOfLine)

Returns dictionary representation of the receiver's cookie properties.
This dictionary can be used with Constructor or cookieWithProperties to create an equivalent NSHTTPCookie object.
(Read only property)

NSHTTPCookieMBS.value as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacControls Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the receiver's value.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display value
MsgBox "Value: "+Cookie.value

(Read only property)

NSHTTPCookieMBS.version 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
Returns the receiver's version.
Example
// query list of all cookies in shared storage
dim cookies(-1) as NSHTTPCookieMBS = NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookies

// pick first one
dim cookie as NSHTTPCookieMBS = cookies(0)

// display version value:
MsgBox "Version: "+str(Cookie.Version)

Returns the receiver's version. Version 0 maps to "old-style" Netscape cookies. Version 1 maps to RFC 2965 cookies.
(Read only property)

The items on this page are in the following plugins: MBS MacControls Plugin.


The biggest plugin in space...