Index: drupal_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_test_case.php,v
retrieving revision 1.27
diff -u -p -r1.27 drupal_test_case.php
--- drupal_test_case.php	23 Jun 2007 10:23:44 -0000	1.27
+++ drupal_test_case.php	24 Jun 2007 08:00:18 -0000
@@ -328,9 +328,14 @@ class DrupalTestCase extends WebTestCase
    * @param object user object with pass_raw property!
    */
   function drupalLoginUser($user = NULL) {
+
+    $this->drupalGet( url("user", NULL, NULL, TRUE) );
+    // Going to the page retrieves the cookie, as the browser should save it
+
     if ($user === NULL) {
       $user = $this->drupalCreateUserRolePerm();
     }
+    
     $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
     $this->drupalPostRequest('user', $edit, 'Log in');
 
Index: tests/upload_tests.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/upload_tests.test,v
retrieving revision 1.8
diff -u -p -r1.8 upload_tests.test
--- tests/upload_tests.test	23 Jun 2007 10:23:44 -0000	1.8
+++ tests/upload_tests.test	24 Jun 2007 08:00:20 -0000
@@ -63,6 +63,9 @@ class UploadPictureTests extends DrupalT
    * @param object user object with pass_raw property!
    */
   function _loginUser($user) {
+    $this->drupalGet( url("user", NULL, NULL, TRUE) );
+    // Going to the page retrieves the cookie, as the browser should save it
+    
     $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
     $this->drupalPostRequest('user', $edit, 'Log in');
     
