Kind of a weird problem, ok, here is my setup ...
- domain.com causes reading from iframe on sub.domain.com
- sub.domain.com makes an ajax call to sub.domain.com/call.php
- sub.domain.com returns ajax call to domain.com
AKA Long-Term Survey
Now everything works fine when there is no session data (I close the browser and reload the page). However, as soon as I reload the page, and their session data, call.php does start_session () and hangs there.
I have tried almost everything and can not figure it out. I tried to destroy the session by disabling all session variables, changing some ini settings, and nothing worked.
Here is the call.php code where the session data is ...
session_start(); $sql = ("SELECT userid FROM status WHERE typing = '".mysql_real_escape_string($userid)."'"); $result = mysql_query($sql); if ($result && mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); $typing_id = $row['userid']; if (!empty($typing_id)) { if (isset($_SESSION['typing2'])) { unset($_SESSION['typing2']); } } else { $typing_id = "-1"; } } else { $typing_id = "-1"; if (isset($_SESSION['typing'])) { unset($_SESSION['typing']); } } if ($_SESSION['typing'] != $typing_id && !isset($_SESSION['typing2']) || $initialize == "1") { $typing = array('typing_id' => $typing_id); } if ($typing_id == "-1") { $_SESSION['typing2'] = "-1"; } else { $_SESSION['typing'] = $typing_id; }
Does anyone have any ideas? I thought this might be domain related, but I'm not sure.
Thanks!
php session
Chris
source share