Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ephmeral session or how to clear logged in state in WKWebView after logout?

オープン
#294 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ios, swift

調査の方向性

まず、issue に記載されている login、logout、2 回目の WKWebView login のシーケンスを再現します。Google SignIn signOut() と、WKWebView、HTTPCookieStorage、WKWebsiteDataStore の処理を追跡します。logout 後に再度開いた WKWebView に、以前キャッシュされた Google アカウントが表示されなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug triage

Describe the bug
I'm wondering how to enable ephemeral session using Google SignIn?
Or how to correctly clear cookies in WKWebView after Google SignIn signOut() method?

To Reproduce
Steps to reproduce the behavior:

  1. Login using Google SignIn
  2. Opens WKWebView with no google account signed in (email field is cleared)
  3. After entering credentials and successful login try to logout
  4. Login again
  5. Opens WKWebView with cached google account

Expected behavior
(5) Opens WKWebView with no google account signed in (email field is cleared)

Screenshots
none

Environment

  • Device: iPhone Simulator
  • OS: iOS 16.2
  • Browser: Safari

Additional context
I tried to clear cookies

  1. In iOS Settings-Safari-Clear History and Website Data

  2. Programmatically:

func clearAllCookies() {

         let url = URL(string: "https://accounts.google.com/Logout")!
         UIApplication.shared.open(url, options: [:], completion: nil)

        if let cookies = HTTPCookieStorage.shared.cookies, cookies.count > 0 {
            HTTPCookieStorage.shared.removeCookies(since: .distantPast)
            print("All cookies deleted")
        }
        
        let dataStore = WKWebsiteDataStore.default()
        dataStore.fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
            records.forEach { record in
                dataStore.removeData(ofTypes: record.dataTypes, for: [record], completionHandler: {
                    print("Deleted:", record)
                })
            }
        }
    }

None of the above worked.

主要言語
Objective-C
スター
751
フォーク
282
平均マージ
4日 20時間
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/GoogleSignIn-iOS のほかの issue

google/GoogleSignIn-iOS の issue をすべて見る

似ている issue

Objective-C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。