Session not persistent on iPadOS. Works fine on iOS. [prefersEphemeralWebBrowserSession]
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 2k
- Forks
- 867
- Avg merge
- 4d 48m
- Merged PRs (30d)
- 1
Description
We are using AppAuth-iOS sdk for one of our project and once the login flow is completed through our app, When we go to the Safari browser(Normal window) and try to access the IDP page, It just logs in automatically fine In iPhone(iOS device) as the cookie is shared and accessible.
Now, when we try the same flow in an iPad Device Safari browser(Normal window), The session is not persisted for Safari browser and it asks for the user name and password again which leads to multiple other issues specific to our app.
Is there some known issue in iPadOS device regarding session and cookies. Why it doesn't work for iPadOS devices and works for iPhone(iOS) device. I am using the latest version of OS on both the devices(iOS 18.1.1 and iPadOS 18.1.1)
I see below code is inside OIDExternalUserAgentIOS responsible to allow the session sharing or Not.
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
authenticationVC.presentationContextProvider = self;
authenticationVC.prefersEphemeralWebBrowserSession = _prefersEphemeralSession;
}
#endif
I checked the value of authenticationVC.prefersEphemeralWebBrowserSession is False and tried setting it to false manually also. But still the issue persists. What could be causing this issue? Appreciate any help on this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at OIDExternalUserAgentIOS and inspect how authenticationVC.prefersEphemeralWebBrowserSession is set for iOS 13 and later. Reproduce the login flow on iOS and iPadOS 18.1.1 with the setting false, then determine whether the session difference comes from AppAuth-iOS, Safari cookie sharing, or the identity provider. Done means a reproducible cause and actionable guidance or a confirmed SDK change to investigate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100