Page MenuHomePhabricator

[S] Sync authentication cookies to in-app web views
Closed, ResolvedPublic

Description

Our in-app web view doesn't set our URLSession authentication cookies, resulting in the user seeing a logged out state when pushing to an in-app web view. This could cause a poor experience for any links to pages that we don't support natively, like non-main namespaces.

We should sync our URLSession authentication cookies with our in-app web views (i.e. the web view in SinglePageWebViewController):

    override func viewDidLoad() {
        
        let cookies = Session.sharedCookieStorage.cookies ?? []
        for (cookie) in cookies {
            webView.configuration.websiteDataStore.httpCookieStore
                .setCookie(cookie)
        }

...
Testing Notes
  1. Log in via app settings.
  2. Go to an in-app web view. One example is article history > diff > tap username button > user page.
  3. In mobile web view, tap the "Desktop" button at the bottom. Confirm you see logged in username in the top right corner of the desktop view.
  4. Log out via app settings.
  5. Repeat steps 2-3. This time confirm user is NOT logged in in Desktop web view.

Event Timeline

LGoto triaged this task as Low priority.May 16 2023, 6:18 PM
LGoto moved this task from Needs Triage to Engineering Backlog on the Wikipedia-iOS-App-Backlog board.

Hi there, found an issue with the mobile app when trying to put together some guidance for wiki trainers who are training those (particularly new users) who are accessing Wikipedia through a phone or tablet, and was advised to comment here with details of the issue.

Although I'm definitely logged in, can edit existing pages and my own talk page, I'm not able to create or access my user page. When I try, I get a notification to say that I'm not logged in - if I try to log in from there, the details appear to go through, but I'm still told that I'm not logged in, and still can't access my user page. I reported this, and was told by a very helpful person that it's because the app doesn't currently support user pages natively.

As part of new user training, as standard we usually get folks to create their user page, as a way to get them used to the editing interface, and to introduce them to the Wiki community. Guidance for supporting editors who are accessing Wiki through a phone or tablet has been identified as a priority by both staff (WMUK) and volunteer trainers, (not everyone that comes to training sessions has a laptop, and this would allow us to reach more people), so anything that could improve that experience would be appreciated :)

Thanks!
Sara

HNordeenWMF raised the priority of this task from Low to Medium.Feb 20 2024, 7:46 PM
Tsevener renamed this task from Sync authentication cookies to in-app web views to [S] Sync authentication cookies to in-app web views.Feb 22 2024, 6:38 PM
JTannerWMF claimed this task.