Setting a cookie in an iPhone App

后端 未结 4 2118
有刺的猬
有刺的猬 2020-12-03 06:14

Is it possible to set a cookie in an iPhone Application that persists, so that later when the user is in Mobile Safari, that cookie can be sent to a webserver?

4条回答
  •  悲&欢浪女
    2020-12-03 06:49

    I believe this is made easy by using the ASIHTTPRequest Library. It encapsulates the use of the global cookie store.

    http://allseeing-i.com/ASIHTTPRequest/How-to-use

    You can make requests with this library which will accrue cookies, and then these cookies will affect other requests later.

    I use this to great effect in accessing authenticated APIs within my iPhone app.

提交回复
热议问题