I have tested the following code:foreach ($_COOKIE as $key=>$val) { echo $key.' is '.$val.<br>n; }This show me all cookies, but the testcookie is not available.---Here my Code in Xcode:let ExpTime = TimeInterval(60 * 60 * 24 * 365 * 50) let cookieProps: [HTTPCookiePropertyKey : Any] = [ HTTPCookiePropertyKey.domain: .mydomain.de, // i dont want to show it here, but there is my domainname HTTPCookiePropertyKey.path: /, HTTPCookiePropertyKey.name: testcookie, HTTPCookiePropertyKey.value: test, HTTPCookiePropertyKey.secure: TRUE, HTTPCookiePropertyKey.expires: NSDate(timeIntervalSinceNow: ExpTime), HTTPCookiePropertyKey.version: 0 ] if let cookie = HTTPCookie(properties: cookieProps) { HTTPCookieStorage.shared.setCookie(cookie) print((cookie)) print(GET COOKIE (HTTPCookieStorage.shared.cookies)) } else { print(set cookie failed) }
Topic:
Programming Languages
SubTopic:
Swift
Tags: