Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie warning pops up in IE11 ShowModalDialog #11507

Closed
oldcookie opened this issue Mar 21, 2017 · 7 comments · Fixed by #14495
Closed

Cookie warning pops up in IE11 ShowModalDialog #11507

oldcookie opened this issue Mar 21, 2017 · 7 comments · Fixed by #14495
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.

Comments

@oldcookie
Copy link

When the tracker is being initialized, configCookiesDisabled is set to true by default. When hasCookies() is called by detectBroweserFeatures() during initialization, this causes a cookie warning dialog to popup twice(each time navigatorAlias.cookieEnabled) is accessed. This occurs every time the modal dialog is opened.

           function hasCookies() {
                if (configCookiesDisabled) {
                    return '0';
                }
                if (!isDefined(navigatorAlias.cookieEnabled)) {
                    var testCookieName = getCookieName('testcookie');
                    setCookie(testCookieName, '1');
                    return getCookie(testCookieName) === '1' ? '1' : '0';
                }
                return navigatorAlias.cookieEnabled ? '1' : '0';
            }
@mattab
Copy link
Member

mattab commented Mar 21, 2017

On IE11 and Win10 I'm not seeing a popup or warning on https://piwik.org

blog

@oldcookie

  • do you use the default JavaScript tracker code on your website or have you customised it in any way?
  • What website URL do you see this warning on IE11?
  • can you see this warning / popup on piwik.org?

@mattab mattab added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Mar 21, 2017
@oldcookie
Copy link
Author

oldcookie commented Mar 22, 2017

  1. Yes, default tracker code.
  2. It's an proprietary webapp that uses a lot of modal dialogs.
  3. I can get it to happen on piwik.org if I open up the console and call window.showModalDialog("http://piwik.org")

screen shot 2017-03-21 at 9 30 47 pm

@mattab
Copy link
Member

mattab commented Mar 22, 2017

Ok thanks for the report. Do you maybe know how to fix this problem?

@oldcookie
Copy link
Author

oldcookie commented Mar 23, 2017

@mattab We can break this down into two problems:

  1. Cookie is required: don't think this is fixable without IE changing it's behavior.
  2. Cookie is disabled: Since cookie is enabled by default and detection of cookie occurs during initialization—before disableCookie can be called—there is currently no way to get around these modals.

To fix #2, may be can can delay the cookie detection until the call to trackPageView?

@siva538
Copy link
Contributor

siva538 commented May 3, 2019

@mattab , we are planning to modify this in the following way, so we can validate this every time consistently.

FYI - we also got the same issue popped up with IE and showmodal dialog combination.

`

    function hasCookies() 
    {
         if (configCookiesDisabled) 
         {
                 return '0';
         }
                var testCookieName = getCookieName('testcookie');
                setCookie(testCookieName, '1');

                return getCookie(testCookieName) === '1' ? '1' : '0';
     }

`

Let us know if you have any concerns with this approach. Thanks in advance.

@mattab
Copy link
Member

mattab commented May 12, 2019

@siva538 could you please open a pull request and not there what issue / use case does it help with? Thanks

@siva538
Copy link
Contributor

siva538 commented May 13, 2019

Sure @mattab . Will do. We ran into an issue with this when there were repeated popup messages as mentioned in screenshot on 3/22/17 above, and browser was asking to insert a cookie.

However the reality was "navigatorAlias.cookieEnabled" is not supported in IE browser during "Show Modal Dialog".

Reason for weightage is that there are still huge number of users across the globe using IE and this fix would help avoid the unnecessary popup's when Modal is used.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants