Tracking Sessions and Calling a web service I have a module that simply has a couple functions that retrieve cookie information, set cookie information and calls a web service using the web service client to help track the users information.  However, when i installed the module, it did not recognize the function that executes the loading of the service from the web service client.  It returned the following error:

Call to undefined function wsclient_service_load()


The code is simple and looks like this:

function set_session_tracking_data() {
$sessionGuid = com_create_guid();

//Time for Cookie Experation
$time = time()+3600;

if (isset($_COOKIE["Drupal_VisitorGUID"])) {
    $sessionId = $_COOKIE["Drupal_VisitorGUID"];
}
else {
    $sessionId = $sessionGuid;

    setcookie('Drupal_VisitorGUID', $sessionId, $time);

    $params = array('visitorGuid' =&gt; $sessionGuid);   
    $service = wsclient_service_load('tracking');
    $result = $service-&gt;CreateVisitor($params);
}
}


The function set_session_tracking_data is being called from a module created solely for tracking purposes.  It has no hooks.  Simply has a function called set_tracking_params() and in that function we call set_session_tracking_data().  The code is below:
    

function set_tracking_params() {
//Sets Module Path
$modulePath = drupal_get_path('module', 'eddy_tracking');

//Time for Cookie Experation
$time = time()+3600;

if (!isset($_COOKIE["cid"]) &amp;&amp; !empty($_GET['cid'])) {
    setcookie('cid', $_GET['cid'], $time);
    dsm($_COOKIE["tsource"]);
}

if (isset($_COOKIE["key"]) &amp;&amp; empty($_GET['key'])) {
    setcookie('key', $_GET['key'], $time);
}

set_tracking_params()
}
set_eddy_tracking_params();


I made the wsclient a dependency but it still does not recognize the function. If i put this same code within a block module i created, the code executes without a hitch.  Can someone please help me with this issue?  Or perhaps someone can mention to me the best practice at setting sessions and tracking a users session.  Any help would be greatly aprreciated.  Thanks!
There seems to be a bit of confusion in your code: the set_tracking_params() function calls itself, which would would result in an infinite recursion. 

That being said, you're calling the set_eddy_tracking_params () function directly in the PHP file which means it will probably be executed before Drupal's full bootstrap has run, and before the wsclient module file has been loaded.

If you're trying to run this function on every page then hook_init() would be the best place for it; it's called early on in every page load:

function MODULENAME_init() {
  set_eddy_tracking_params();
}