Drupal register its own session handling functions through session_set_save_handler()
during bootstrap (drupal_bootstrap()
). It also sets it own session mame in conf_init()
.
Because of the Drupal's handlers, restoring the WHMCS' session name before using standard PHP session will not work. PHP will use Drupal's hanlder to open, read, write, etc. session information. All you will get is the data for a wrong Drupal's session returned from sess_read()
when called by PHP.
One way to read WHMCS' session is to figure out how it is stored and to access it without using PHP's sessions functions.
Another way may be to undo what Drupal has done (changing session name and registering handlers) to restore default behaviors of PHP's session functions, read the WHMCS' session and restore Drupal's session name and handlers.