Odd $_SESSION contents
The $_SESSION variable contains values set by Drupal; in your case, $_SESSION['batches'] is the value set by the Batch API. Drupal, although, doesn't use the session to store the user ID; that value is stored in the $user global variable, as cilefen correctly said in his comment.

global $user;
$uid = $user-&gt;uid;
$roles = $user-&gt;roles;


Keep in mind that the $user global variable doesn't contain a fully-loaded user object; to get that, you need to use the following code.

$account = user_uid_optional_load();


$account will contain every field associated with the user entity, and any property attached to the user object from third-party modules.