I'm building a simple shopping cart using Angular and ASP.NET Core with. There is no login require and user can always checkout and make payment as a guest. The front end would be built with Angular, with simple 3 dynamic components - Shop > Checkout > Payment path in a single path. I'm presuming I will be relying on Angular router to handle the page transition.
However, I'm thinking whether I should use session cookies to maintain the state of the application. For example if the user has added up the items into the cart, a clean refresh would not clear their progress and bring the user back to the beginning. If the user is on payment step, any refresh would not restart their session. I know some prefers to store the session in Localstorage but that's not my preference.
For normal ASP.NET application which renders the view via AJAX, I don't have to worry about this. However, how can I make sure the SPA is stateful and session will be timeout if its idle for certain amount of time?