Show user-friendly message when user blocks third-party cookies

XMLWordPrintable

    • 2

      Problem Definition

      Questions users cannot post a question if third-party cookies are blocked on their browsers with the following error:

      Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document
      

       

      This happens if user changes their browser setting to block third-party cookies.
      Since Question is implemented as add-on and its resources is hosted on the different domain from Confluence Cloud, users should enable third-party cookies.

      However, the problem is Questions users cannot realise they need to change the setting.

      Suggested Solution

      Detect if localStorage is available and show the friendly notice not to block third-party cookies.

      if (typeof window.localStorage !== 'undefined') {
          // SETUP SESSION, AUHT, LOCALE, SETTINGS ETC
      } else {
          // PROVIDE FEEDBACK TO THE USER
      }
      

      Workaround

      • For a Chrome user: go to chrome://settings/content/cookies (Settings > Content settings > Cookies), and make sure to enable "Allow local data to be set (recommended)" and disable "Block third-party cookies"

      Related Documents

            Assignee:
            Unassigned
            Reporter:
            K. Yamamoto
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: