I want to store my cookies so that when i reopen the application i can restore the ones stored in the previous instance. To initialize alamofire i use:
let manager = Alamofire.Manager.sharedInstance
And my code to load cookies is:
let cookies = NSHTTPCookie.cookiesWithResponseHeaderFields(headerFields, forURL: URL)
Alamofire.Manager.sharedInstance.session.configuration.HTTPCookieStorage?.setCookies(cookies, forURL: URL, mainDocumentURL: nil)
But when i reboot the phone it forgets all the cookies.