AP.
AP.

Reputation: 5323

iPhone: know programmatically is cookies are allowed or not

I need for my app to have cookies enabled in Safari and I was wondering 2 things: - How to detect if cookies are allowed or not - How to allow cookies

For the moment my googling was not really successful...

Thanks for your help :)

Upvotes: 0

Views: 782

Answers (1)

mxg
mxg

Reputation: 21254

You can't force Safari to accept cookies.

But you cat detect if they're allowed, by redirecting.

Here's how you can do:

  1. At the first page you can set a verification cookie.
  2. Forward to the second page.
  3. At the second page, check if the verification cookie is there. If it is missing, then it doesn't accept cookies.

Upvotes: 2

Related Questions