Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX script stopped remembering session
    primarykey
    data
    text
    <p>I little while back I posted <a href="https://stackoverflow.com/questions/9769795/using-same-session-id-in-ajax-cant-connect-to-mysql-db">this question</a>. I have updated that question with the AJAX script that worked for about 1 week. Basically I can use <code>session_start()</code> from the AJAX script, and then I could access the session variables that I needed. </p> <p>It is really strange, but I came in after the weekend, and this morning this script does not work anymore. It is very simple, here:</p> <pre><code>&lt;?php session_start(); $ajax_connection = mysql_connect('10.X.X.X',$_SESSION['username'],$_SESSION['password']); $result_set = array(); while ($result_set[] = mysql_fetch_assoc($results)){ // do nothing } echo json_encode($results); ?&gt; </code></pre> <p>Last week this worked flawlessly, and now in my error log i get the <code>Undefined index: username</code> and <code>Undefined index: password</code> warnings. And of course the MySQL connection is not established. So this script is not running the same session as the original connection. I used <code>error_log(session_id())</code> to check the IDs of the parent page and the AJAX script, and sure enough they are different. When i reload the page and try every again, the IDs stay the same for the page and the AJAX script respectively, but they should be the same ID, not 2 different ones. </p> <p>Anyway, does anyone have any idea why this wouldn't be working anymore, after working well for over a week?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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