Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a solution for you.</p> <h3>Set the session like this:</h3> <pre class="lang-php prettyprint-override"><code>if(!isset($_SESSION['speelid'])){ $id_query = mysql_query ("SELECT * FROM Tour11_deelnemers WHERE fb_id = '$user'"); while ($record = mysql_fetch_assoc ($id_query)){ $id = $record['deelnemer_id']; } if($id &gt; 0){ $_SESSION['speelid'] = $id; } } </code></pre> <h3>Check if a session is set like this:</h3> <pre class="lang-php prettyprint-override"><code>if(isset($_SESSION['speelid'])){ echo "Ingelogd"; } </code></pre> <h2>Update</h2> <p>It seems like the issue is related to >= IE6 refusing to accept the session cookie generated by the php, when a <code>.php</code> file is referred from an <code>.html</code> file on a different server.</p> <h3>.HTML to .PHP session IE issue</h3> <blockquote> <p>When using session variables in a .php file referred by a frame (.html, or other file type) at a different server than the one serving the .php:</p> <p>Under these conditions IE6 or later silently refuses the session cookie that is attempted to create (either implicitly or explicitly by invoquing session_start()).</p> <p>As a consequence, your session variable will return an empty value.</p> <p>According to MS kb, the workaround is to add a header that says your remote .php page will not abuse from the fact that permission has been granted.</p> <p>Place this header on the .php file that will create/update the session variables you want:</p> </blockquote> <p><a href="http://www.phpfreaks.com/forums/index.php?topic=157539.msg685903#msg685903" rel="nofollow">Here is a full thread on this issue</a></p> <h3>Solution</h3> <p>The solution is to add this at the very top of the page which will SET the session.</p> <pre><code>&lt;?php header('P3P: CP="CAO PSA OUR"'); ?&gt; </code></pre>
 

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