Losing session data in middle of test

Working on an eCommerce website, wrote a simple test to add a product to my cart and proceed through checkout. When going from the shopping cart to checkout, there is a login page in between landing on the shipping page of checkout. After proceeding past the login page, I am redirected back to my shopping cart without any products in it (an empty cart).

We are making an API call to the client’s middleware after user enters their email address in login form to do a customer lookup for an existing account, I believe that’s where the loss is coming from

I have never ran into this, so unsure what to do. Also, still fairly new to codecept framework and test automation in general