ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.04k stars 999 forks source link

bug: first party http cookie deleted after period of time (iOS/Android) #5721

Open matthiastz opened 2 years ago

matthiastz commented 2 years ago

Bug Report

Capacitor Version

  @capacitor/cli: 3.5.1
  @capacitor/core: 3.5.1
  @capacitor/android: 3.5.1
  @capacitor/ios: 3.5.1

Platform(s)

native Apps on iOS, Android

Current Behavior

Expected Behavior

Already logged in users should not loose their session (Cookie) automatically, but stay logged in. Cookie storage never should get deleted.

Code Reproduction

Can not share any code, since these are private company repos. But I can describe some basic setup: we have lots of JS/TS code, that handle our views. Capacitor is used to wrap this and deploy a native iOS and Android App for the users.

Our main backend that is used by the App handles authentication and authorization (and other parts), we setup the main domain for the server.hostname config in capacitor.config.json, e.g. when the backend runs at https://some.domain.com we set server.hostname to domain.com (relevant: https://github.com/ionic-team/capacitor/issues/1373#issuecomment-707822708)

Other Technical Details

npm --version output:

node --version output:

pod --version output (iOS issues only): 1.11.3

Additional Context

Hints for possible causes for this issue

Thx already for any info and help! 🙂

matthiastz commented 2 years ago

@thomasvidas any idea how this could happen? 🤔

d00ML0rDz commented 1 year ago

We've been seeing the same behaviour on the iOS version of our app, where our auth cookies seem to get removed after about a week of not opening the app on an iOS device.

Don't suppose you've found any work arounds for this @matthiastz?

jjang16 commented 9 months ago

We're seeing the similar cookie-dropping behavior in our ios app. The cookie dropping behavior is flaky. It happens only on some ios devices. I'm guessing this issue might be related to ios privacy / tracking constraints..... or not. :(