Default device back button not working properly with tabs

I have the below page structure
Login --> Tabs --> products list --> cart

When i login in login page, i am showing the default tabs page where i have 4 tabs(Home, Search, Cart, More). When i click on merchant item in the home page, i am navigating to merchant details page, where i will show list of menu items provided by him. Once i add few items to cart from menu page i will add them to cart. I am showing a button to go to cart. When he click on the button, the user will go to cart page, where he will see all the items added to cart.
Here when the user clicks on the device back button he is going to login page, not to the products list page.
In browser it is working fine, but not in real device.
Please help me to fix the issue.

Stack overflow link