Skip to content
Extraits de code Groupes Projets
  • diosmosis's avatar
    7cc3bfc4
    Fixes #3135, fix opt-out form on Safari browsers by opening new window that sets the cookie. · 7cc3bfc4
    diosmosis a rédigé
    This PR allows us to set 3rd party cookies in the opt-out form for Piwik. It works by opening a new window on form submission, reloading the new window, and setting the cookie on this reload. It is necessary to reload the window, because the session cookie isn't set, so the nonce won't be detected & so, the ignore cookie won't be set.
    
    It works whether JavaScript is enabled or not, and other browsers still get the better UX.
    
    The new window is closed immediately after opening, if JS is enabled.
    
    There is also a new UI test for the opt out form, plus a small change to the UI testing framework to allow switching the user agent during tests.
    7cc3bfc4
    Historique
    Fixes #3135, fix opt-out form on Safari browsers by opening new window that sets the cookie.
    diosmosis a rédigé
    This PR allows us to set 3rd party cookies in the opt-out form for Piwik. It works by opening a new window on form submission, reloading the new window, and setting the cookie on this reload. It is necessary to reload the window, because the session cookie isn't set, so the nonce won't be detected & so, the ignore cookie won't be set.
    
    It works whether JavaScript is enabled or not, and other browsers still get the better UX.
    
    The new window is closed immediately after opening, if JS is enabled.
    
    There is also a new UI test for the opt out form, plus a small change to the UI testing framework to allow switching the user agent during tests.