I\'m developing an application where the server hands me a cookie to identify the user.
My successive requests need to have that cookie to have the response that the use
humayun might be right -
However you should not be writing cookies to NSUserDefaults -
The whole point of the sharedHTTPCookieStorage is you read them from there.
NSArray *httpCookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:httpUrl];
You should not even be able to write those cookies to NSUserDefaults for security reasons. But maybe you can. Either way its probable that the timeout wasnt set as humayun mentioned.
Either way please refactor your code and dont try to store cookies in user prefs.