fix cookie .secure property

This commit is contained in:
xuty 2020-03-27 07:40:52 +08:00
parent 7d9f9f56a4
commit fcb965eac6
1 changed files with 3 additions and 1 deletions

View File

@ -90,7 +90,9 @@ class MyCookieManager: NSObject, FlutterPlugin {
if maxAge != nil {
properties[.maximumAge] = String(maxAge!)
}
properties[.secure] = (isSecure != nil && isSecure!) ? "TRUE" : "FALSE"
if isSecure != nil && isSecure! {
properties[.secure] = "TRUE"
}
let cookie = HTTPCookie(properties: properties)!
MyCookieManager.httpCookieStore!.setCookie(cookie, completionHandler: {() in