<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Cross-domain cookies/sessions in Safari and all other browsers</title>
	<atom:link href="http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/feed/" rel="self" type="application/rss+xml" />
	<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/</link>
	<description>on web development</description>
	<pubDate>Thu, 17 May 2012 06:33:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sat</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-39842</link>
		<dc:creator>Sat</dc:creator>
		<pubDate>Tue, 06 Mar 2012 16:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-39842</guid>
		<description>Can anyone tell me what goes in blank.php?</description>
		<content:encoded><![CDATA[<p>Can anyone tell me what goes in blank.php?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eliz</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-37294</link>
		<dc:creator>Eliz</dc:creator>
		<pubDate>Wed, 15 Feb 2012 21:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-37294</guid>
		<description>Works for me with the modification above... awesome :)</description>
		<content:encoded><![CDATA[<p>Works for me with the modification above&#8230; awesome <img src='http://anantgarg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaurav Karwal</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-22888</link>
		<dc:creator>Gaurav Karwal</dc:creator>
		<pubDate>Tue, 29 Nov 2011 12:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-22888</guid>
		<description>Hi Anant,

I implemented this hack but what is happening is that teh flag "firstTimeSession" gets reset since the form is being submitted and thus, the code is going into a perpetual loop submitting the form everytime.

How come it did not occur to anyone else?</description>
		<content:encoded><![CDATA[<p>Hi Anant,</p>
<p>I implemented this hack but what is happening is that teh flag &#8220;firstTimeSession&#8221; gets reset since the form is being submitted and thus, the code is going into a perpetual loop submitting the form everytime.</p>
<p>How come it did not occur to anyone else?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ron</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-22337</link>
		<dc:creator>ron</dc:creator>
		<pubDate>Thu, 24 Nov 2011 07:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-22337</guid>
		<description>Hello,

I want to implement cookie manager in safari.
this tool need to allow me to read and write persistent cookies.
Do you have and idea how to implement this in Safari 


Thanks guys</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I want to implement cookie manager in safari.<br />
this tool need to allow me to read and write persistent cookies.<br />
Do you have and idea how to implement this in Safari </p>
<p>Thanks guys</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidMB</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-20065</link>
		<dc:creator>DavidMB</dc:creator>
		<pubDate>Fri, 04 Nov 2011 13:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-20065</guid>
		<description>This helped me alot.
There are a few errors that needed correction. For instance, there are two "action" attributes on the submitform. The last one should be method=post.

I found out that things were not executed in the correct order. (I used jquery.ready() to solve this).

Also, I found out a way to find out when the iframe has fully loaded the page.

$("#sessionframe").load(function()
{
     alert("Sessionframe fully loaded");
});

For this to work you need the sessionframe to be inside the DOM of the page. In other words, you need to put this just after the append, the problem here is that the submission will be take place at the instant when append is executed.

To solve it all:
 $(document).ready(function ()
    {
        $("body").append('');
        $("#sessionframe").load(function () {
            alert("Iframe is fully loaded");
        });
        submitSessionForm();
    });</description>
		<content:encoded><![CDATA[<p>This helped me alot.<br />
There are a few errors that needed correction. For instance, there are two &#8220;action&#8221; attributes on the submitform. The last one should be method=post.</p>
<p>I found out that things were not executed in the correct order. (I used jquery.ready() to solve this).</p>
<p>Also, I found out a way to find out when the iframe has fully loaded the page.</p>
<p>$(&#8221;#sessionframe&#8221;).load(function()<br />
{<br />
     alert(&#8221;Sessionframe fully loaded&#8221;);<br />
});</p>
<p>For this to work you need the sessionframe to be inside the DOM of the page. In other words, you need to put this just after the append, the problem here is that the submission will be take place at the instant when append is executed.</p>
<p>To solve it all:<br />
 $(document).ready(function ()<br />
    {<br />
        $(&#8221;body&#8221;).append(&#8221;);<br />
        $(&#8221;#sessionframe&#8221;).load(function () {<br />
            alert(&#8221;Iframe is fully loaded&#8221;);<br />
        });<br />
        submitSessionForm();<br />
    });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-15529</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 03 Aug 2011 04:12:05 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-15529</guid>
		<description>PHP server side scripting did the trick for me.

Firsty, as suggested above, set the header:

header('p3p: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"');

From here on in, IE is fine, for other browsers, had to set a session variable then refresh the page on the first run.

if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == false)
		{
			if(!isset($_SESSION['FIRST_RUN']))
			{
				$_SESSION['FIRST_RUN'] = TRUE;
				header('Location: ' . Conf::SITE_PATH . '/school/login');
				exit;
			}
		}</description>
		<content:encoded><![CDATA[<p>PHP server side scripting did the trick for me.</p>
<p>Firsty, as suggested above, set the header:</p>
<p>header(&#8217;p3p: CP=&#8221;ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV&#8221;&#8216;);</p>
<p>From here on in, IE is fine, for other browsers, had to set a session variable then refresh the page on the first run.</p>
<p>if(strpos($_SERVER['HTTP_USER_AGENT'], &#8216;MSIE&#8217;) == false)<br />
		{<br />
			if(!isset($_SESSION['FIRST_RUN']))<br />
			{<br />
				$_SESSION['FIRST_RUN'] = TRUE;<br />
				header(&#8217;Location: &#8216; . Conf::SITE_PATH . &#8216;/school/login&#8217;);<br />
				exit;<br />
			}<br />
		}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Cook</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-14306</link>
		<dc:creator>Rob Cook</dc:creator>
		<pubDate>Wed, 22 Jun 2011 15:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-14306</guid>
		<description>Hi Guys,

Thanks for this, have been looking for the solution for ages. 

Great work and it woeks a treat, keep up the good work</description>
		<content:encoded><![CDATA[<p>Hi Guys,</p>
<p>Thanks for this, have been looking for the solution for ages. </p>
<p>Great work and it woeks a treat, keep up the good work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evilbloodydemon</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-13450</link>
		<dc:creator>evilbloodydemon</dc:creator>
		<pubDate>Thu, 12 May 2011 06:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-13450</guid>
		<description>timeout in sample code is broken
setTimeout(processApplication_()_,2000);
should be 
setTimeout(processApplication,2000);</description>
		<content:encoded><![CDATA[<p>timeout in sample code is broken<br />
setTimeout(processApplication_()_,2000);<br />
should be<br />
setTimeout(processApplication,2000);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rachit</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-13012</link>
		<dc:creator>Rachit</dc:creator>
		<pubDate>Thu, 28 Apr 2011 19:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-13012</guid>
		<description>Once the sessionframe is submitted, is there anyway to call a function from the parent page (remote domain)? So, instead of the 2 sec hack, I want to make sure I do things only after a confirmed response from the startsession.php.

The order of the events I see with the mentioned approach :
(1) host remote domain page (let's call mainpage.htm)
(2) blank.php
(3) startsession.php

I want the response of #3 to invoke some javascript on #1. I'm playing with the response type of json and other but none of them seem to be working.

Anyone any idea?

Thanks!</description>
		<content:encoded><![CDATA[<p>Once the sessionframe is submitted, is there anyway to call a function from the parent page (remote domain)? So, instead of the 2 sec hack, I want to make sure I do things only after a confirmed response from the startsession.php.</p>
<p>The order of the events I see with the mentioned approach :<br />
(1) host remote domain page (let&#8217;s call mainpage.htm)<br />
(2) blank.php<br />
(3) startsession.php</p>
<p>I want the response of #3 to invoke some javascript on #1. I&#8217;m playing with the response type of json and other but none of them seem to be working.</p>
<p>Anyone any idea?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suraj Shrestha</title>
		<link>http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/comment-page-1/#comment-11650</link>
		<dc:creator>Suraj Shrestha</dc:creator>
		<pubDate>Wed, 30 Mar 2011 12:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://anantgarg.com/?p=336#comment-11650</guid>
		<description>How come nobody noticed that there was action="post" in line 15 of first code. It should have been method="post".</description>
		<content:encoded><![CDATA[<p>How come nobody noticed that there was action=&#8221;post&#8221; in line 15 of first code. It should have been method=&#8221;post&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

