Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active March 13, 2024 10:33
Show Gist options
  • Save iegik/f96930139e767a89fcf3a5ef4b2f8fc3 to your computer and use it in GitHub Desktop.
Save iegik/f96930139e767a89fcf3a5ef4b2f8fc3 to your computer and use it in GitHub Desktop.

Don't allow sites to save data on your device

Will prevent use of localStorage, sessionStorage

chrome://settings/content/siteData

Settings > Privacy and security > Site settings > Additional content settings > On-device site data > Don't allow sites to save data on your device

localStorage
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
sessionStorage
Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
indexedDB.databases()
Uncaught (in promise)
Uncaught (in promise) DOMException: Failed to execute 'databases' on 'IDBFactory': Access to the IndexedDB API is denied in this context.

Cookies

chrome://settings/cookies

Settings > Privacy and security > Third-party cookies > Block third-party cookies

test case

NOTE: Chrome do not allow to paste javascript: URLs directly

Not allowed in javascript:

javascript:console.log('Cookies enabled:', navigator.cookieEnabled, 'allowed:', (() => {try {return !!document.cookie} catch { return false }})());document.cookie=`test=true; expires=${new Date(+Date.now()+1000).toUTCString()}`;

Not allowed in data:text/html

data:text/html;,<scr…ing()}`;</script>:1 Uncaught DOMException: Failed to set the 'cookie' property on 'Document': Cookies are disabled inside 'data:' URLs.

data:text/html;,<script>console.log('Cookies enabled:', navigator.cookieEnabled, 'allowed:', (() => {try {return !!document.cookie} catch { return false }})());document.cookie=`test=true; expires=${new Date(+Date.now()+1000).toUTCString()}`;</script>

Enhanced protection

chrome://settings/security

Settings > Privacy and security > Security > Enhanced protection

Technical and functional purpose

Property Cookie Purpose Term
Google com __Secure-1PAPISID Cookie necessary for the use of the website's options and services In 2 years
Google com __Secure-1PSID Cookie necessary for the use of the website's options and services In 2 years
Google com __Secure-1PSIDCC Cookie necessary for the use of the website's options and services in a year
Google com __Secure-3PSIDCC Cookie necessary for the use of the website's options and services in a year
Google com CGIC Cookie necessary for the use of the website's options and services in 6 months
Google com CONSENT Google Cookie Consent Tracker In 17 years
Google com OGP Cookie necessary for the use of the website's options and services in 17 days
Google com OGPC Cookie necessary for the use of the website's options and services in 2 months
Google com SEARCH_SAMESITE SameSite prevents the browser from sending this cookie along with requests between sites. The main objective is to mitigate the risk of cross-origin information leakage. It also provides some protection against cross-site request forgery attacks. in 6 months
mail.google.com __Host-GMAIL_SCH Cookie necessary for the use of the website's options and services Session
mail.google.com __Host-GMAIL_SCH_GML Cookie necessary for the use of the website's options and services in 19 days
mail.google.com __Host-GMAIL_SCH_GMN Cookie necessary for the use of the website's options and services in 19 days
mail.google.com __Host-GMAIL_SCH_GMS Cookie necessary for the use of the website's options and services in 19 days
mail.google.com __Secure-OSID Cookie necessary for the use of the website's options and services In 2 years
mail.google.com COMPASS Cookie necessary for the use of the website's options and services in 10 days
mail.google.com OSID Cookie necessary for the use of the website's options and services In 2 years

Analytics

Property Cookie Purpose Term
Google com __Secure-3PAPISID These cookies are used to deliver more relevant ads to you and your interests. In 2 years
Google com __Secure-3PSID These cookies are used to deliver more relevant ads to you and your interests. In 2 years
play.google.com _ga ID used to identify users In 2 years

Rack

Property Cookie Purpose Term
Google com 1P_JAR These cookies are set through embedded YouTube videos. They record anonymous statistical data on, for example, how many times the video plays and the settings used for the playback. in a month
Google com APISID Download certain Google tools and save certain preferences, for example, the number of search results per sheet or the activation of the SafeSearch filter. Adjust the ads that appear in Google search. In 2 years
Google com DV These cookies are used to collect website statistics and track Google ad conversion rates and personalization. Session
Google com HSID Download certain Google tools and save certain preferences, for example, the number of search results per sheet or the activation of the SafeSearch filter. Adjust the ads that appear in Google search. In 2 years
Google com NID These cookies are used to collect website statistics and track Google ad conversion rates and personalization. in 7 months
Google com OTZ Aggregate analysis of site visitors in a month
Google com SAPISID Download certain Google tools and save certain preferences, for example, the number of search results per sheet or the activation of the SafeSearch filter. Adjust the ads that appear in Google search. In 2 years
Google com SID Download certain Google tools and save certain preferences, for example, the number of search results per sheet or the activation of the SafeSearch filter. Adjust the ads that appear in Google search. In 2 years
Google com SIDCC Download certain Google tools and save certain preferences, for example, the number of search results per sheet or the activation of the SafeSearch filter. Adjust the ads that appear in Google search. in a year
Google com SSID Download certain Google tools and save certain preferences, for example, the number of search results per page or the activation of the SafeSearch filter. Adjust the ads that appear in Google Search. In 2 years
mail.google.com S Facebook browser identification, authentication, marketing and other Facebook specific function cookies. Session
play.google.com OTZ Aggregate analysis of site visitors Session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment