Hello everyone. I was racking my brain for a few hours today over a problem pertaining to an AJAX call in jQuery.
Basically, I have the user click an item in a <select> list. Upon clicking an <option> a .post request is sent to a script, which gives me some HTML data to be added to part of the page. That part works fine. But, the server-side script also stores a variable in the $_SESSION variable when it's called. But this is not stored in the clients session as I anticipated. It appears to be being stored in the server session or something. Yes, session_start() is at the top of all files. To test, I used print_r to output the whole $_SESSION variable in both my static script, and to be returned by the AJAX call. The main script outputs an entire slew of data stored in the $_SESSION variable, but the content of the returned HTML shows only the single element in the $_SESSION array that is set by that script. I also had both scripts output their session_id()'s, and they're both different. I attempted to use session_id() to set the ID of the AJAX script to that of the main script (by sending the session_id as a variable to the AJAX script, of course), but that didn't help either. I couldn't figure out why this isn't working. Any help would be greatly appreciated. Thank you!