here is my code
let cookieProperties = [
NSHTTPCookieOriginURL: Constants.baseUrl,
NSHTTPCookiePath: "/",
NSHTTPCookieName: "device_id",
NSHTTPCookieValue: Constants.deviceId
]
let cookiePropertiesVersion = [
NSHTTPCookieOriginURL: Constants.baseUrl,
NSHTTPCookiePath: "/",
NSHTTPCookieName: "app_version_code",
NSHTTPCookieValue: "50"
]
let newCookie = NSHTTPCookie(properties: cookieProperties)
let newCookieVersion = NSHTTPCookie(properties: cookiePropertiesVersion)
cookieStorage.setCookie(newCookie!)
cookieStorage.setCookie(newCookieVersion!)
Error is at line
cookieStorage.setCookie(newCookie!)
newCookie is nil and
unexpectedly found nil while unwrapping an Optional value
error comes