-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS cookies not persistent after app exit and restart unlike Android #509
Comments
Could you please confirm if this is also the case when using |
Yes. Its the case. Just tried with both options. Tried following ionic-team/cordova-plugin-ionic-webview#22 for any solution and specifically tried this https://github.com/CWBudde/cordova-plugin-wkwebview-inject-cookie but without any success. May be i was placing in code in wrong place or namespace is wrong or may be ionic thats why |
Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md |
I also am encountering this issue and have tested with both usewkwebview=yes and usewkwebview=no. If necessary I can create a test application, but it may take some time. I'm using _blank target, as in example above, and am unclear whether it's necessary to use _self target in order to have cookies work, though this doesn't appear to be the case based on the documentation. narayanncube, could you please let me know if you're still running into this issue? NOTE: This is not an issue for us -- in further testing it became clear that the relevant cookies were "session" cookies, so natually weren't persisted across separate instances of running the app. Once those response cookies were set to have an explicit, future-dated expirations the inappbrowser worked perfectly. My bad. PEBKAC. |
Any solution? I have the same problem. |
1 similar comment
Any solution? I have the same problem. |
Per my comment above, this actually was a problem with how we were creating the cookies server-side. They were being created as session cookes (without an expiration date), so would expire as soon as the app was closed because each instance of the app creates a separate inappbrowser instance. By setting an explicit expiration date on the cookie returned by the server this causes the browser to treat it as persistent, rather than for just a single session, and it's there for subsequent instances of the app. In our case we have no need for the cookie to ever expire so we're setting it to have a 12/31/9999 expiration when returned in the response from the server. |
Hi, how do you resolved this? I'm trying to start session or set cookies but i can't with Phonegap. If i try from server with any browser session set ok. |
@michaellavender |
@narayanncube Did you find a way to explicitly set the cookie expiration? I'm trying to find how I might do the same. I'm currently using the same plugin you mentioned to inject a cookie, so I'm trying to find how to either update this inject-cookie plugin to set the expiration there, or to just get rid of the plugin, and inject the cookie manually and set the expiration myself... |
Bug Report
Problem
In iOS cookies are not persistent once app is exited and restarted. This creates problem with hosted web app saving cookies or local storage.
On Android it works
What is expected to happen?
It should save cookies and local storage on IOS
What does actually happen?
It doesn't save cookies and local storage.
Information
Command or Code
var ref = cordova.InAppBrowser.open('http://www.syncaridebeta.com', '_blank', 'location=no,toolbar=no,usewkwebview=yes,clearcache=no,clearsessioncache=no,cleardata=no,disallowoverscroll=yes');
Environment, Platform, Device
Version information
Checklist
The text was updated successfully, but these errors were encountered: