Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear cookies for a given iOS App

My App connects to a server and based on a cookie the server will issue a different response.

Is it no possible to programmatically clear the cookie store, so that the server will not recognize my App when it contacts the server the next time.

I gathered that clearing the Cookies in the Settings.app does only apply for cookies within Safari.

Thanks very much for your comment.

like image 680
Besi Avatar asked Nov 16 '11 15:11

Besi


People also ask

Can you delete cookies for a specific website iPhone?

Delete cookies on iOS And on iOS, you can delete all your Safari browser cookies by going to Settings > Safari, and then tap the option to Clear history and website data. To delete specific cookies, scroll down and tap Advanced, then Website Data. Type in the search field, then swipe to delete an entry.

Do iOS apps have cookies?

A normal iOS application does not contains cookies. An app will have cookies only if the application has one or more web views. To check where are the app cookies stored on iPhone, On an iPhone, go to Settings -> Safari -> Advanced -> Website Data and you will see all cookies stored on your device.


1 Answers

Okay... following up on my earlier comment (and hoping this is the solution you are looking for), you probably want to utilize:

[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:]

for each of the cookies for your site.

like image 123
Michael Dautermann Avatar answered Oct 03 '22 17:10

Michael Dautermann