2

Safari by default blocks third-party cookies dropped with iframes.

What is the disadvantage to simply replacing that functionality with localStorage in the same way, which it appears not to block? Are there any limitations on localStorage that do not exist with cookies?

<!-- filename localstorage.php -->
<script type="text/javascript">

    if (window.localStorage !== "undefined"){

        window.localStorage.user_id = "thomas123";

    }

</script>




<!-- filename call_localstorage.php -->
<iframe src="http://jsbin.com/UpelOcU/1/" width=1 height=1 border=0></iframe>

<script tyle="text/javascript">

    document.write(JSON.stringify(localStorage)); //{"user_id":"thomas123"}

</script>
Community
  • 1
  • 1
1252748
  • 14,597
  • 32
  • 109
  • 229

0 Answers0