title: SFAuthenticationSession/ASWebAuthenticationSession and logging out
body: <p>I'm planning to switch an app from the old OAuth flow with the <code>SFSafariViewController</code> to the new flow with iOS 11's <code>SFAuthenticationSession</code>. Logging in isn't an issue, the transfer to the new API took me a few minutes to implement. However logging out has me baffled.</p>
  
  <p>How?</p>
  
  <p>I can't find any mentioning of wanting to offer the option of logging out anywhere in the docs. Using the old <code>SFSafariViewController</code> to invalidate the cookies? Nope, they're not shared anymore with <code>SFAuthenticationSession</code>. As soon as I restart the authentication session the user get's logged in automatically and there's no way out. So how to enable logging out? Or am I simply overlooking something completely obvious?</p>
  
  <p>Update:
  I found a "way that works" in a technical sense, but it's bonkers for the user: Open a new SFAuthenticationSession on the logout page that clears the cookie. But that means when logging out the alert view asks the user again whether he'd like to <em>log in</em> via the service. If <em>yes</em> is selected ("logging in"), the cookie clearing logout page is opened, the user has to manually dismiss the view, which can be caught by the completion handler and we know we can open the login view again.. displaying the login prompt to log out? I <strong>really</strong> don't like this solution.</p>
  
  <p>Any ideas? Am I still overlooking a completely obvious solution?</p>
  
  <p>Update 2: As no one has any clue about this issue so far, this is probably not an easy one. I have filed a suggestion with Apple via their report tool to either clarify how to handle this or build it into the API if not available. Will post if I get an answer.</p>
  
  <p>Update 3: After pondering the issue a bit more we found another possible (although also unattractive) solution <em>if</em> you can influence the login page of the OAuth provider: make cookies very short lived. Then the login page can be opened without automatic log in. However this kills the whole purpose of sharing login sessions between apps.. and you need to be able to influence the login page.</p>
  
  <p>Update 4: Since iOS 12 <code>SFAuthenticationSession</code> is deprecated and got replaced by <code>ASWebAuthenticationSession</code>. However <code>ASWebAuthenticationSession</code> does not change anything in regard to logging out. It's still not possible. Same issue as before.</p>