1

I have a web application built with php which uses cookies and sessions to store logged user information. Since updating my iPhone X to iOS 11.3 I can't send post request with Ajax to post to DB anymore, my post script sends me back to the login page, just like I'm no longer logged in. I'm clueless! The application works like a charm on all other iOS versions, Androids, PCs, and I have'nt made any updates to it. Also tried with Chrome on iOS with same result... Not so much into iOS development, anyone who knows something about this?

2 Answers2

0

You may try setting cache: 'no-store for every Ajax request:

fetch('/path/to/auth', {
  credentials: 'same-origin',
  cache: 'no-store'
});

Alternatively, you may set:

$.ajaxSetup({ cache: false });

See https://forums.developer.apple.com/thread/89050

Peter Keller
  • 7,526
  • 2
  • 26
  • 29
-1

I have solve the problem. You can add

NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];

in the -(void)webViewDidStartLoad:(UIWebView *)webView.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
沈文涛
  • 1
  • 1