Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to set Cookies on Live Domain on IE on a Specific Situation
    text
    copied!<p>I have a project hosted on a live server has a domain like: www.abc.com</p> <p>On live domain: I am unable to set cookies in IE (7, 8, 9, 10) - as it is explained in the code below - (cookies are enabled on the IE browser), but able to set cookies in Firefox, Chrome, Opera and Safari without any problem. The server time is correct (current time of Jordan)</p> <p>On localhost: Cookies are working perfect on all browsers!</p> <p>My code explained exactly as below:</p> <p>In the page: "localhost/test.php", I put the below code to read the content of show.php which resides in the live server:</p> <pre><code>&lt;?php foreach (file('http://abc.com/api/show.php') as $o) echo $o ?&gt; </code></pre> <p>In the page <a href="http://abc.com/api/show.php" rel="nofollow">http://abc.com/api/show.php</a>:</p> <pre><code>&lt;script&gt; function hookscript(url){ var s = document.createElement("script"); s.type = "text/javascript"; s.src = url || null; document.getElementsByTagName("head")[0].appendChild(s); } hookscript('http://abc.com/aj/ajax.php?part=1'); &lt;/script&gt; </code></pre> <p>In the page <a href="http://abc.com/aj/ajax.php" rel="nofollow">http://abc.com/aj/ajax.php</a>:</p> <pre><code>function hookscript(url){ var s = document.createElement("script"); s.type = "text/javascript"; s.src = url || null; document.getElementsByTagName("head")[0].appendChild(s); } &lt;?php $part = $_GET['part']; ?&gt; &lt;?php if($part==1){ ?&gt; &lt;?php setcookie('test',time(),time()+3600) ?&gt; hookscript('http://abc.com/aj/ajax.php?part=2'); &lt;?php } if($part==2){ if(isset($_COOKIE['test'])){ ?&gt; alert('Cookies SET'); &lt;?php } else{ ?&gt; alert('Cookies NOT SET'); // WHY! &lt;?php } } ?&gt; </code></pre> <p>Would appreciate your hints! Thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload