Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSHTTPCookieMBS class.
NSHTTPCookieMBS .Constructor(properties as dictionary)
Creates an initialized NSHTTPCookie object using the provided properties.
Example
// create dictionary with properties: dim prop as new Dictionarydim d as new date d.Year = d.Year + 1 prop.Value(NSHTTPCookieMBS .NSHTTPCookieVersion)="0" prop.Value(NSHTTPCookieMBS .NSHTTPCookieName)="test" prop.Value(NSHTTPCookieMBS .NSHTTPCookieValue)="some value" prop.Value(NSHTTPCookieMBS .NSHTTPCookieOriginURL)="http://www.mbsplugins.de/" prop.Value(NSHTTPCookieMBS .NSHTTPCookieDomain)="www.mbsplugins.de" prop.Value(NSHTTPCookieMBS .NSHTTPCookiePath)="/" prop.Value(NSHTTPCookieMBS .NSHTTPCookieExpires)=d// create cookie from properties dim cookie as new NSHTTPCookieMBS (prop)// and display properties dim dic as Dictionary = cookie.propertiesdim list(-1 ) as string for each key as Variant in dic.keys List.Append key.StringValue+": " +dic.Value(key).StringValuenext MsgBox Join(list,EndOfLine)
properties: The properties for the new cookie object, expressed as key value pairs.
Handle is non zero on success.
NSHTTPCookieMBS .portList as Integer()
Returns the receiver's port list.
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 port list dim PortList(-1 ) as Integer = cookie.portListif UBound(PortList)=-1 then MsgBox "Port List: all ports." else dim list(-1 ) as string for each port as Integer in portList List.Append str(port) next MsgBox "Port List: " +Join(list, ", " )end if
The list of ports for the cookie, returned as an array of integers. If the cookie has no port list this method returns nil and the cookie will be sent to any port. Otherwise, the cookie is only sent to ports specified in the port list.
The items on this page are in the following plugins: MBS MacControls Plugin .