# iOS 11 embedded Safari changes

**URL:** https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172
**Category:** Development
**Created:** [8월 31, 2017, 8:32오후 UTC](https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172 "2017-08-31T20:32:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 31, 2017, 8:32오후 UTC](https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172/1 "2017-08-31T20:32:49Z")

</div>

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

> [@Logged out of forum on iOS](https://meta.discourse.org/t/logged-out-of-forum/60298/4):
>
> I only ever saw this on iPhone and only if you are using the app (usually combined with having it open in Safari) It is a reproduced bug in iOS which I reported to apple, no idea how what to do here short of allowing cookies to live for significantly longer times on iOS or disabling cookie cycling altogether on iOS.

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.

> **[SFAuthenticationSession | Apple Developer Documentation](https://developer.apple.com/documentation/safariservices/sfauthenticationsession)**
>
> A class that manages sharing a one-time login between Safari and an app, which can also provide automatic login for associated apps.

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:

> [@HEIF file type not allowed for upload](https://meta.discourse.org/t/heif-file-type-not-allowed-for-upload/64068):
>
> Hey, My users use iPhones and some of them are on the beta of iOS 11. They can’t upload their images as they are in HEIF file format not JPEG.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 31, 2017, 8:41오후 UTC](https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172/2 "2017-08-31T20:41:00Z")

</div>

> [@david](#):
>
> A “Safari View Controller” instance no longer shares cookies with Safari.

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.

@j.jaffeux 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.
