objective c - How to clear cookies from NSHTTPCookieStorage more then once? -


My desktop app connects to web applications hosted on Google App Engine. Once certified, it is a authtoken cookie It goes that all this passes along with future requests. It all works.

But now I want to add "sign out". I have tried to apply sign out like this:

  - (zero) signout {NSHTTPCookieStorage * cookiestorage = [NSHTTPCookieStorage shared HTTP cookiestost]; (NSHTTPCookie * [cookieStorage cookiesForURL: [NSURL URLWithString: self.serviceRootURLString]] per) Autores]] [[cookiestorage deleteCookie: each]; } [Self clear credential storage]; }  

The problem is that it only works for the first time. For example I can open my app sign in. Make some requests Sign out. So the next time I make a request, I am asked to prove again. good!

But when I certify another time then there is a problem. Authentication works. I get authtoken cookie. I can request but then when I try to log out second time (my app Without restarting), authtoken cookie does not seem to be removed. It seems to be removed from the perspective of my apps ... I ask NSHTTPCookieStorage for cookies that has my URL in it and it does not give any returns but if I request another request (which should require authtoken cookie) , The request only works, I do not get 401 response and I am never asked to prove again.

By understanding things correctly, it seems that cookies are removed from my perspective, but these built-in URL loading frameworks are not removed from perspective.

Possibly, maybe the problem is related to:

Does anyone know how to implement the "logout" functionality in an app that interacts with a web service? is?

Thank you, Jesse

Theory: Other relevant cookies that are used by the URL of your service Are not under, because some requests are the result of a redirect which can get or set cookies on your system.

Apart from this: I suggest you actually see what is happening on the network, and know which cookies are being sent or received.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -