diff --git a/core/modules/field/tests/field.test b/core/modules/field/tests/field.test
index 214eab4..9a50c89 100644
--- a/core/modules/field/tests/field.test
+++ b/core/modules/field/tests/field.test
@@ -3208,6 +3208,49 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
   }
 }
 
+class FieldCacheTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Field Cache Garbage',
+      'description' => 'Tests ...',
+      'group' => 'Field API',
+    );
+  }
+
+  function testConcurrentLogin() {
+    $this->user1 = $this->drupalCreateUser(array());
+    $this->user2 = $this->drupalCreateUser(array());
+
+    // Login first user.
+    $this->drupalLogin($this->user1);
+    $this->assertText($this->user1->name);
+
+    // Login second user.
+    $this->drupalLogin($this->user2, TRUE);
+    $this->assertText($this->user2->name);
+
+    // Switch to first user.
+    $this->drupalLogin($this->user1);
+    $this->drupalGet('user');
+    $this->assertText($this->user1->name);
+
+    // Switch to second user.
+    $this->drupalLogin($this->user2);
+    $this->drupalGet('user');
+    $this->assertText($this->user2->name);
+
+    // Log out second user.
+    $this->drupalLogout();
+
+    // Switch to first user and confirm that we're still logged in.
+    $this->drupalLogin($this->user1);
+    $this->drupalGet('user');
+    $this->assertText($this->user1->name);
+  }
+}
+
 /**
  * Tests entity properties.
  */
diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index 0edd3fd..6f920ae 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -1224,11 +1224,33 @@ class DrupalWebTestCase extends DrupalTestCase {
    *
    * @param $user
    *   User object representing the user to log in.
+   * @param $new
+   *   (optional) Whether to create a new, concurrent user session. Pass TRUE
+   *   for first login.
    *
    * @see drupalCreateUser()
    */
-  protected function drupalLogin(stdClass $user) {
-    if ($this->loggedInUser) {
+  protected function drupalLogin(stdClass $user, $new = FALSE) {
+    // If there is a session attached on $user already, try to use that directly.
+    if (isset($user->curlHandle)) {
+      $this->curlHandle = $user->curlHandle;
+      $output = $this->drupalGet('user');
+      if (!strpos($output, 'user/login')) {
+        $this->pass(t('User %name is logged in.', array('%name' => $user->name)), t('User login'));
+        return;
+      }
+      // The last known session is no longer valid; forget it and continue with
+      // regular login below.
+      unset($user->curlHandle);
+    }
+    // If we're asked to create a new session, unset the current.
+    elseif ($new) {
+      unset($this->curlHandle);
+    }
+
+    // In any case, if we are logged in already and are asked to re-login, log
+    // out first.
+    if ($this->loggedInUser && $this->loggedInUser->uid == $user->uid) {
       $this->drupalLogout();
     }
 
@@ -1243,6 +1265,10 @@ class DrupalWebTestCase extends DrupalTestCase {
     $pass = $this->assertLink(t('Log out'), 0, t('User %name successfully logged in.', array('%name' => $user->name)), t('User login'));
 
     if ($pass) {
+      // Save the user's session on the account itself.
+      $user->curlHandle = $this->curlHandle;
+
+      // Switch the currently logged in user.
       $this->loggedInUser = $user;
     }
   }
