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
F开发者_如何学编程or the moment my googling was not really successful...
Thanks for your help :)
You can't force Safari to accept cookies.
But you cat detect if they're allowed, by redirecting.
Here's how you can do:
- At the first page you can set a verification cookie.
- Forward to the second page.
- At the second page, check if the verification cookie is there. If it is missing, then it doesn't accept cookies.
精彩评论