By default, anon customers shoppingcart's are not merged with the logged in customer when they login to an existing account. I have made the following change to applogic.cs(around line 2717) to make them merge:

Code:
            if ((ItemsInCartNow > 0 && AppLogic.AppConfigBool("PreserveActiveCartOnSignin")) || AppLogic.AppConfigBool("ClearOldCartOnSignin")) // but not wish list, gift registry or recurring items!
            {
                // if preserve is on, force delete of old cart even if not set at appconfig level, since we are replacing it with the active cart:
                DB.ExecuteSQL("delete from ShoppingCart where CartType=" + ((int)CartTypeEnum.ShoppingCart).ToString() + " and customerid=" + NewCustomerID.ToString());
                DB.ExecuteSQL("delete from kitcart where CartType=" + ((int)CartTypeEnum.ShoppingCart).ToString() + " and customerid=" + NewCustomerID.ToString());
                DB.ExecuteSQL("delete from customcart where CartType=" + ((int)CartTypeEnum.ShoppingCart).ToString() + " and customerid=" + NewCustomerID.ToString());
            }
// START MOD
            else if (ItemsInCartNow > 0 && !AppLogic.AppConfigBool("PreserveActiveCartOnSignin")) // Merge the anon items with the logged in customer items
            {
                if (CurrentCustomerID != 0)
                {
                    // if preserve is off, update anon cart to merge with logged in customer cart
                    Customer c = new Customer(NewCustomerID);
                    DB.ExecuteSQL("update ShoppingCart set CustomerID=" + NewCustomerID.ToString() + ", billingaddressid=" + c.PrimaryBillingAddressID.ToString() + " , ShippingAddressID=" + c.PrimaryShippingAddressID.ToString() + " where CartType in (" + ((int)CartTypeEnum.ShoppingCart).ToString() + ") and customerid=" + CurrentCustomerID.ToString());
                    DB.ExecuteSQL("update kitcart set CustomerID=" + NewCustomerID.ToString() + " where CartType in (" + ((int)CartTypeEnum.ShoppingCart).ToString() + ") and customerid=" + CurrentCustomerID.ToString());
                    DB.ExecuteSQL("update customcart set CustomerID=" + NewCustomerID.ToString() + " where CartType in (" + ((int)CartTypeEnum.ShoppingCart).ToString() + ") and customerid=" + CurrentCustomerID.ToString());
                    DB.ExecuteSQL("update customer set OrderNotes=" + DB.SQuote(CurrentCustomerOrderNotes) + ", FinalizationData=NULL, OrderOptions=" + DB.SQuote(CurrentOrderOptions) + " where customerid=" + NewCustomerID.ToString());
                }
            }
// END MOD
This can be easily changed to match what you want it to do based off of your appconfig settings. Mine looks at the number of items in the anon cart and if it's greater than 0 and PreserveActiveCartOnSignin is false, it merges the carts.