Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

[iOS] Config option: requestCachePolicy #249

Closed
Meshz opened this issue Jan 30, 2017 · 2 comments
Closed

[iOS] Config option: requestCachePolicy #249

Meshz opened this issue Jan 30, 2017 · 2 comments

Comments

@Meshz
Copy link

Meshz commented Jan 30, 2017

I'm trying to auth my user to SharePoint. It is working fine in Android but I'm facing a problem in iOS.

One of the requests for auth uses several redirects which set cookies. The first time I sign in, all the redirects are followed but the second time, I'm going straight to the last redirect and then some cookies are not set. I can confirm this by cleaning the iOS simulator (xcrun simctl erase all) and it is working fine again the first time only.

I found this link exposing the requestCachePolicy parameter (also this one describing a bit more). I tried to set defaultConfigObject.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData in RNFetchBlobNetwork.m:250 but it does not seem to work. As I have never used Objective-C I may be missing something.

Thank you for your help and time.

@wkh237
Copy link
Owner

wkh237 commented Feb 1, 2017

Try add Cache-Control : no-store to headers.

@Meshz
Copy link
Author

Meshz commented Feb 1, 2017

@wkh237 Thank you for that suggestion but this doesn't solve my problem.

After deeper tests, I saw that the fedAuth cookie received on first login is kept and resend when logging back again. This is why the redirects are different. This behavior is not the same than in Android.

Is there any way to get/remove the cookies stored in RNFB? If not, I can check the last redirect and switch to the last part of auth if user already have a token. So this issue can be marked as solved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants