Example 3rd party cookie with external workaround

<- Go back to the overview

This is the page with the cookie fix applied by using the external workaround. All needed code is already included in the ai_external.js. Therefore please to to the "external workaround" tab in the administration for more details. See here for a working demo. In the example below the file framed_ai_external_js.html, is on the remote domain www.mdempfle.de in the folder "fix". The example includes the page framed_ai_external_js.html that does set a cookie, tries to read it again and does include the ai_external.js. So depending on your browser settings the 3rd party cookie is accepted or not.

This is NOT the recommended way to apply this fix because it adds much more overhead your page then the _safari_fix.html solution. But if you can only add Javascript on the other domain this is maybe your only choice.

To enable the fix please do the following steps:

  1. Apply the external workaround like explained in the administration on the "external workaround" tab by adding the ai_external.js. For this fix I recommend to include the ai_external.js to the header because otherwise the whole page is loaded and executed and the redirect back to the parent does happen really late!
  2. Set safari_fix_url like explained below.

The example below enables the fix for all browsers and shows a message if the fix cannot be applied. The short code parameter for this demo safari_fix_url="all:message:src". Simply remove all or message if you don't want to use this feature.

  • "all:" enables the fix for all browsers
  • "message:" shows a Javascript message if the fix cannot be applied. If you need to localize the message you can set this by setting the Javascript variable "safari_cookie_fix_message"  before including ai_external.js.
  • src: enables the fix for the external workaround. It adds "safari_cookie_fix=true" and "safari_cookie_fix=message" dynamically to the src when needed. ai_external.js does evaluate the parameter safari_cookie_fix. If cookies are completely disabled a message is shown which can be localized by setting the Javascript variable "safari_cookie_fix_no_cookie_message" before including ai_external.js.

PS: If you want to test this whole feature here and you don't have a MAC I recommend to test with Firefox because there you can set all 3 possible values for the 3rd party cookies!

If the workaround is applied once you need to delete the cookies "aifixed" and "aichecked" from www.tinywebgallery.com and the cookies "safari_cookie_fix" and "the_cookie"  from www.mdempfle.de to try it again. Otherwise also the example without a fix is now working.

Shortcode:
[advanced_iframe width="50%" height="200" src="//www.mdempfle.de/fix/framed_ai_external_js.html" safari_fix_url="all:message:src"]

Example without a fix

Example with safari_fix.html

Example with safari_fix.html - Safari only