Page 1 of 1

debug tool showing "The user id is not set" error

PostPosted: 01 May 2014, 16:10
by SKhoshbuie
Hi and thanks for this wounderfull programm.
I use arrowchat on a PHPFOX website and can not see the users as logged in users!
waht schoud i change in integration.php file and how may i fix this error? maybe a problem with the function get_user_id() ... ?
thank you

PostPosted: 23 May 2014, 10:27
by JSICKMEYER
I had to modify the function to get the $userid set based on session or cookie.

Code: Select all
function get_user_id() 
   {
      $userid = NULL;
      
      if (!empty($_SESSION['memberId']))
      {
         $userid = $_SESSION['memberId'];
                }
      
      if (!empty($_COOKIE['memberId']))
      {
         $userid = preg_replace('#[^0-9]#','',$_COOKIE['memberId']);
      }
      
      return $userid;
   }


If that is not the problem, perhaps the table is not set correctly to pull the userid?

Another thing I did was in the init.php file, I included my sites typical functions used for logging in and setting sessions/cookies. I then started the custom sec_session_start() function I built before setting the $userid:

Code: Select all
include 'path-to/your-functions-file.php';
sec_session_start();
$userid    = get_user_id();


The session would not be set otherwise and therefore the userid would be null.

I hope that makes sense. I'm still learning this system. :)

Cheers!

Topic Closed

PostPosted: 16 Dec 2014, 00:26
by Staff Bot
[b]This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.[/b]