Example 3rd party cookie with _safari_fix.html

<- Go back to the overview

This is the page with the cookie fix applied by calling _safari_fix.html that is on same domain as the iframe. In the example below all needed files (framed.html, _safari_fix.html, _safari_fix_message.html) are on the remote domain www.mdempfle.de in the folder "fix". The example includes the page framed.html that does set a cookie and tries to read it again. So depending on your browser settings the 3rd party cookie is accepted or not.

This is the recommended way to apply this fix because it adds the smallest overhead to your page. If you only can add Javascript on the other domain please look at the example that uses ai_external.js.

To enable the fix please do the following steps:

  1. Copy the file wp-content/plugins/advanced-iframe/includes/_safari_fix.html to a directory on the domain where the iframe page is. In this file you can also change the message displayed  or localize it if cookies are disabled completely.
  2. If you want to show a message copy the file wp-content/plugins/advanced-iframe/includes/_safari_fix_message.html to a directory on the domain where the iframe page is. In this file you can also change the message displayed or localize it.
  3. 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 is safari_fix_url="all:message:http://www.mdempfle.de/fix". 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 enable this you need to copy the file wp-content/plugins/advanced-iframe/includes/_safari_fix_message.html to the same folder as _safari_fix.html
  • "http://www.mdempfle.de/fix" the url to the folder where the _safari_fix.html and _safari_fix_message.html are located

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.html" safari_fix_url="all:message://www.mdempfle.de/fix"]

Example without a fix

Example with safari_fix.html - Safari only

Example with external workaround (ai_external.js)