How to Clear the Shopping Cart Session Variable

Coreysan 1,811 Reputation points
2022-03-13T00:52:39.927+00:00

I'm learning to build a store in MVC Core 3.1, and everything works so far.

The Checkout button calls the CheckoutController Index method, where a javascript calls Paypal and finishes up the purchase.

However, I totally forgot to clear the shopping cart when the purchase is complete.

So far, it all ends when the Index view method is called, and that's it. So how do I put a line inside the view to clear the Shopping Cart,
or redirect maybe somewhere to do the work?

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.