I'm sending http requests with session-cookie stored on the device side. The problem is that I want to persist it across app termination. But it seems like all the cookies of my app get deleted. I tried on both the simulator and device and they got the same behavior.
Is there any iOS way to prevent this cookie deletion? If not, how can I save it to disk and recover it back?
I'm planning to save this cookie in iOS keychain for security. And I think all NSHTTPCookie properties can be safely converted to NSString. So my current idea is to convert from NSHTTPCookie -> NSDictionary -> String -> Save in Keychain, and go backward to use get the original cookie. The problem is I don't want to go through the hassles of converting NSDictionary -> String and parsing String -> NSDictionary.