iOS 11 embedded Safari changes

I recently updated my iPhone to the public beta of iOS 11, and noticed an annoying change which impacts the Discourse app. I’m not sure there’s actually much we can do about it, so this is more of a heads-up. This is not a bug in the beta, it is an intended change from Apple.

A “Safari View Controller” instance no longer shares cookies with Safari. This means if you’re logged into discourse in safari, you will not be automatically logged in when you use the app.

Once you log in within the app, the cookies are persisted across app restarts, so it’s only an issue on first use.

One advantage of this is that it will probably reduce/stop the occurance of this bug

Apple has provided an alternative system for shared cookies, “SFAuthenticationSession”. I believe this is designed for initial authorisation though, rather than long term use to actually access a website.

https://developer.apple.com/documentation/safariservices/sfauthenticationsession

The only potential solution I can think of is that the app uses SFAuthenticationSession to let the user authenticate using Safari cookies, then somehow loads some session cookies into the app’s own cookie store…


On a related note, this issue is not present in the current beta (as predicted). Images get uploaded as JPG, as before:

7 Likes

Hard to describe how much hugs I can give this, cause this logout bug is infuriating, looks like Apple are ACTUALLY reading my stuff.

I think for the interim we are just going to have to deal with the “double login” issue.

@joffreyjaffeux and I will have a think about this problem and see if we can use the new interface somehow, but I do not expect us to work on any hacks here for at least 2-3 months.

8 Likes