清除给定 iOS 应用程序的 cookie [英] Clear cookies for a given iOS App

查看:62
本文介绍了清除给定 iOS 应用程序的 cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序连接到服务器,服务器将根据 cookie 发出不同的响应.

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

有没有可能以编程方式清除cookie存储,以便服务器下次联系服务器时不会识别我的应用程序.

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.

我发现在 Settings.app 中清除 Cookie 仅适用于 Safari 中的 Cookie.

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

非常感谢您的评论.

推荐答案

好的...跟进我之前的评论(并希望这是您正在寻找的解决方案),您可能想要利用:

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:]

对于您网站的每个 cookie.

for each of the cookies for your site.

这篇关于清除给定 iOS 应用程序的 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆