-
Notifications
You must be signed in to change notification settings - Fork 215
[BUG] iOS users getting logged out #3466
Copy link
Copy link
Open
Description
Summary
On iOS, users are automatically logged out after some time when using the SFCC PWA in a WebView. This does not happen on Android.
Steps To Reproduce
- Set up a clean SFCC PWA project using the basic scaffold.
- Use example data from RefArch in Business Manager.
- Wrap the PWA in an Expo React Native WebView (default config, no cookies or headers manually overridden).
- Log in with a shopper account.
- Leave the app idle for X minutes or background it. This is variable and can be after 30 minutes or sometimes after a day or more.
- Return to the app — user is logged out.
Expected result
The session should persist as long as it does on Android or in mobile browsers.
Actual result
On iOS, the session expires and the user is logged out after a period of inactivity.
System Information (as applicable)
Browser: iOS Webview
Node version: 22
pwa-kit version: 3.13
Mobile Device Info: iOS 18.x
Additional information
It seems to be linked to the way cookies are handled. We managed to fix the issue internally by patching the @salesforce/commerce-sdk-react library and using localStorage as storage type instead of cookies but a structural fix would be prefered.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels