タブを閉じるだけでCookieを自動削除。ログインしたいサイトだけ残せる拡張機能「TabCookieCleaner」
ブラウザを使っていると、いつの間にかCookieやキャッシュがたまります。かといってブラウザの設定で全部消すと、毎日使うサイトのログインまで消えて、入り直しが面倒です。
そこで作ったのが TabCookieCleaner です。「ログインを残したいサイト」だけを登録しておくと、それ以外のサイトのデータを、タブを閉じたときに自動で消してくれます。
できること
- タブを閉じると、そのサイトのCookie・キャッシュ・LocalStorage・IndexedDB・ServiceWorkerを自動で削除
- ホワイトリストに登録したサイトは、ログイン状態をそのまま維持(サブドメインも自動で保護)
- 別のサイトに移動したときも、設定した待機時間のあとに削除(0秒にすれば即時)
- ワンクリックで、未登録サイトのデータをまとめて削除
- ブラウザ起動時に、前回の残りを一括削除(設定でON/OFF)
- ホワイトリストと設定のインポート・エクスポート
- 開いているタブのアイコンが、登録済みなら緑、未登録なら赤になるので、ひと目で分かる
- 9言語対応、ダーク/ライトテーマ切り替え
使い方
- 拡張機能をインストールします。初期状態では、自動削除はOFFです。
- 普段ログインしているサイトを開いて、ポップアップから「ホワイトリストに追加」を押します。
- 登録が終わったら、ポップアップの自動削除をONにします。
最初に登録してから、自動削除をONにするのがポイントです。 登録の前にONにすると、ログイン中のサイトも消えてしまうことがあります。
安全に消すためのこだわり
Cookieは、単純に「ドメインが同じかどうか」だけでは安全に消せません。次の点に気をつけて作っています。
.co.jpや.com.twのような国別ドメインを、公開されているドメイン一覧をもとに正確に判定します。関係のない別のサイトのCookieは巻き込みません。mail.google.comのようにサブドメインだけを登録しても、ログインに使う親ドメイン(.google.com)のCookieは保護します。- 登録済みサイトのLocalStorageやIndexedDBには、触れません。
- 他のタブで同じサイトを開いている間は、削除しません。
知っておいてほしいこと
- Edgeをお使いの方へ: Edge本体には「閉じるときに閲覧データをクリアする」設定があります。ここで「Cookie およびその他のサイト データ」がONだと、この拡張機能とは関係なく、閉じるたびに全サイトからログアウトされます。OFFにしておいてください。
- 広告ブロッカーなど、他の拡張機能が原因のこともあります: ログアウトが起きたときは、この拡張機能とは別の原因がないか、確認してみてください。
- 消せないもの:
file://のページのデータや、他の拡張機能自身の領域は、削除の対象外です。
[Chrome Web Store] https://chromewebstore.google.com/detail/fgbdpmmabohmpbkecbohmhadnnpcmadp?utm_source=item-share-cb
Support Me☕
TabCookieCleaner: Automatically Delete Cookies When You Close a Tab, and Keep Only the Logins You Want
Over time, your browser quietly piles up cookies and cache. But if you clear everything from the browser settings, you also lose the logins for the sites you use every day, and signing in again is a hassle.
That’s why I made TabCookieCleaner. Register only the sites whose login you want to keep, and the extension automatically deletes the data of every other site when you close its tab.
What it does
- When you close a tab, it automatically deletes that site’s cookies, cache, LocalStorage, IndexedDB, and ServiceWorker data
- Sites on your whitelist stay logged in (subdomains are protected automatically)
- When you navigate to a different site, the previous one is deleted after a delay you can set (set it to 0 seconds for instant deletion)
- One-click cleanup of the data from all sites not on your whitelist
- Optionally clean up leftovers from the previous session when the browser starts (can be turned on or off in the settings)
- Import and export your whitelist and settings
- The icon of each open tab turns green for whitelisted sites and red for unregistered ones, so you can tell at a glance
- Available in 9 languages, with dark and light themes
How to use it
- Install the extension. Auto-delete is OFF by default.
- Open the sites you usually stay logged in to, and click “Add to whitelist” in the popup.
- Once you’ve registered them, turn auto-delete ON in the popup.
The key is to register your sites first, and only then turn auto-delete ON. If you turn it on before registering, you may lose the logins of sites you’re currently signed in to.
Built to delete safely
Cookies can’t be deleted safely just by checking whether the domain matches. Here is what I paid attention to:
- Country-specific domains such as
.co.jpand.com.tware identified accurately, based on the public list of domain suffixes, so cookies from unrelated sites are never caught up in a cleanup. - Even if you register only a subdomain like
mail.google.com, the cookies on the parent domain that the login depends on (.google.com) are protected. - LocalStorage and IndexedDB of whitelisted sites are never touched.
- While another tab is open on the same site, nothing is deleted.
Good to know
- If you use Edge: Edge has its own “Clear browsing data every time you close the browser” setting. If “Cookies and other site data” is turned on there, you’ll be logged out of every site whenever you close the browser, regardless of this extension. Please turn it off.
- Other extensions, such as ad blockers, can also be the cause: If you get logged out unexpectedly, check whether something other than this extension is responsible.
- What can’t be deleted: Data of
file://pages and the storage areas of other extensions are outside the scope of cleanup.



