Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:24:35+00:00 2026-06-04T09:24:35+00:00

I’m sending http requests with session-cookie stored on the device side. The problem is

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:24:36+00:00Added an answer on June 4, 2026 at 9:24 am

    ===== SUMMARY =====

    Well, I’m going to create another answer just to summarize possible ways to persist a NSDictionary (that doesn’t contain objects of course!).

    The easiest way to do this is to use NSDictionary’s writeToFile: method. This will generate a plist file. (Also available in NSArray) If you’re worried about security, encrypt the array to an NSData object and write that.

    Another way, not the fastest one though, is to use a tool to convert NSDictionary to a string format such as JSON or XML. You can save this string in iOS keychain and retrieve it later easily. (SFHFKeychainUtils is a great for helping with keychain stuff). A good thing about using keychain is it is automatically encrypted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.