Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.194
diff -u -r1.194 form.inc
--- includes/form.inc	7 May 2007 10:15:57 -0000	1.194
+++ includes/form.inc	9 May 2007 14:25:21 -0000
@@ -1834,7 +1834,7 @@
  *   URL of the batch processing page.
  */
 function batch_process($redirect = NULL, $url = NULL) {
-  global $form_values, $user;
+  global $form_values;
   $batch =& batch_get();
 
   // batch_process should not be called inside form _submit callbacks, or while a
@@ -1868,7 +1868,7 @@
         $batch['destination'] = $_REQUEST['edit']['destination'];
         unset($_REQUEST['edit']['destination']);
       }
-      db_query("INSERT INTO {batch} (bid, sid, timestamp, batch) VALUES (%d, %d, %d, '%s')", $batch['id'], $user->sid, time(), serialize($batch));
+      db_query("INSERT INTO {batch} (bid, sid, timestamp, batch) VALUES (%d, %d, %d, '%s')", $batch['id'], session_id(), time(), serialize($batch));
       drupal_goto($batch['url'], 'op=start&id='. $batch['id']);
     }
     else {
Index: includes/batch.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.inc,v
retrieving revision 1.1
diff -u -r1.1 batch.inc
--- includes/batch.inc	4 May 2007 09:41:36 -0000	1.1
+++ includes/batch.inc	9 May 2007 14:25:20 -0000
@@ -8,11 +8,9 @@
  * State based dispatcher for batches.
  */
 function _batch_page() {
-  global $user;
-
   $batch =& batch_get();
 
-  if (isset($_REQUEST['id']) && $data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d AND sid = %d", $_REQUEST['id'], $user->sid))) {
+  if (isset($_REQUEST['id']) && $data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d AND sid = %d", $_REQUEST['id'], session_id()))) {
     $batch = unserialize($data);
   }
   else {
