How to Clear the Shopping Cart Session Variable

Coreysan 1,651 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?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
{count} votes