I am working on a php based chat.
here is the main script logic.
1. the user logs in and he is added to the database. A new session is started and in this session is registerd an object "person" that holds the userID, discussionID and stuff like that..
2. then the script is called from 2 to 2 seconds like this
"person.php?sid=948579345793475$reason=get_msg" and here is how the part that processes the request looks:
session_id($sid);
session_start();
$template->set_file("tpl_handle","get_msg.tpl");
$msg = trim($person->Display($discussionID, $lastmessagetime, "one"));
$template->set_var("MESSAGE", $msg);
$template->set_var("SID", "sid=".$sid."&");
$template->parse("output", "tpl_handle");
$template->p("output");
$lastmessagetime = $person->LastMessageTime($discussionID);
the importan line is:
$msg = trim($person->Display($discussionID, $lastmessagetime, "one"));
$person is an instance of the class "Person".
everithing works fine for a while, but after that i get an error something like "call to undefined function, person is not an object " ore something like that. It could happen only if the object is not restored back from the the session.
So the question is, why the session dies?
PS: it's interesting that if i press F5 everithing starts to work again, then it dies back.
PSS: if anyone thinks that he could help me on this subject, but needs more info, please contact me "tristan@pisem.net"