cordova-plugin-wkwebview-inject-cookie
cordova-plugin-wkwebview-inject-cookie copied to clipboard
Cookie needs to set an expiration for compatibility with InAppBrowser
Re: https://github.com/apache/cordova-plugin-inappbrowser/issues/509#issuecomment-513484460
The linked issue from InAppBrowser explains: "In iOS cookies are not persistent once app is exited and restarted. This creates problem with hosted web app saving cookies or local storage."
And the linked issue comment itself is from a user who attempted to use cordova-plugin-wkwebview-cookie-sync but to no effect. I'm also using this plugin which has been working well, except that when exiting the app to the system browser, through InAppBrowser, the user is immediately logged out of the app, loses session/cookies, and returns to find the app landing/login screen, rather than where they originally exited from.
If cordova-plugin-wkwebview-cookie-sync could set an expiration, arbitrarily far into the future (e.g. "12/31/9999") it should solve this problem (re: https://github.com/apache/cordova-plugin-inappbrowser/issues/509#issuecomment-550363198).
"... By setting an explicit expiration date on the cookie returned by the server this causes the browser to treat it as persistent."
Could you advise on how to set the expiration? (Either hardcoded in the plugin, or as an argument when calling "injectCookie").