Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Whos Online error correction question


bibleman

Recommended Posts

I had an error that was created by the Whos Online addon.

 

When logging on to the frontend of the site https://www.ministryhelps.com/login.php?action=process

 

I would get this error: 

 

Fatal error: Call to undefined function tep_whos_online_update_session_id() in /var/www/vhosts/ministryhelps.com/httpdocs/includes/functions/sessions.php on line 191

 

So in the sessions file I made the following simple change.

 

 

 

 

 function tep_session_recreate() {
    global $SID;
 
    if (PHP_VERSION >= 5.1) {
      $old_id = session_id();
 
      session_regenerate_id(true);
 
      if (!empty($SID)) {
        $SID = tep_session_name() . '=' . tep_session_id();
      }
 
tep_whos_online_update_session_id($old_id, tep_session_id());
    }
  }

 

 

 

 

 

 

To fix the error I changed it to this

 

 function tep_session_recreate() {
    global $SID;
 
    if (PHP_VERSION >= 5.1) {
      $old_id = session_id();
 
      session_regenerate_id(true);
 
      if (!empty($SID)) {
        $SID = tep_session_name() . '=' . tep_session_id();
      }
 
// tep_whos_online_update_session_id($old_id, tep_session_id());
    }
  }

 

 

I simply commented out the offending code: // tep_whos_online_update_session_id($old_id, tep_session_id()); and it fixed the error I was getting.

 
I have checked the rest of the site and everything seems to be working OK.
 
My question is:  
 
What did this line do?
 
Is it needed... and am I missing something by commenting it out?
 
Thanks
Leon
 
 

 

I'm having a great Day - hope you are too!

 

Leon

Link to comment
Share on other sites

If you search the addon files, you should find a definition for this function; then you'll know. It looks like it's probably intended to keep the who's online view in admin closer to what's really happening in the store (when an existing user logs in you can get multiple sets of footprints).

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

tep_whos_online_update_session_id was introduced in v2.3.3.3 in order to prevent duplicates showing in who_online page, see https://library.oscommerce.com/Online&en&oscom_2_3&release_notes&v2_3_3_3

 

If this function is missing, you might have more missing.

 

When asking for help, always state your osCommerce version.

 

Burt,

 

The link you gave told me what I was asking.

 

Thanks

Leon

I'm having a great Day - hope you are too!

 

Leon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...