Search code examples
iosangularjscookiesuiwebviewsession-cookies

iOS UIWebView and Cookies storage


I use Cordova 4, Angular 1.4 and Ionic 1.3 to make a tablet app for Android and iOS.

When user synchronised datas, app opened another window (cordova-plugin-inappbrowser) and displayed our SSO webpage. When user ended to connect, window was closed and synchronisation was send again.

Android store session cookie when app is closed but iOS don't. Each time user open app on iOS, he need to open window authentificator.

Is it a way to store much longer cookies on iOS ?

Thanks


Solution

  • EVURLCache may help you.

    This is a NSURLCache subclass for handeling all web requests that use NSURLRequest. (This includes UIWebView)

    The EVURLCache is meant for handeling the following caching strategies:

    • The app has to be functional even if there is no internet connection.
    • The app has to be functional right after the app has been downloaden from the app store. (This means that the required content can be included in the app.)
    • You do want to be a able to download new/updated content if it's available.

    Note:

    Support: iOS 8+ OSX 10.9+ WOS 2+ TVOS 9+