ASP.NET CORE - Online Shop Order As Guest / Anonymous User

448 Views Asked by At

I am developing an online store and I want customers to have the opportunity to order without logging in to the system, ie to have the opportunity to order as a Guest or anonymous user. Any ideas?

Thanks in advance!

2

There are 2 best solutions below

1
Aleksandar M. On

add AllowAnonymous attribute to actions or controllers. Then user don't need to do log in.

[

[AllowAnonymous]
   public class Orders: Controller
        {
            [AllowAnonymous]
            public ActionResult PlaceOrder()
            {
            }
    
        public ActionResult Get()
        {
        }
    }
0
Morteza Asadi On

You can set a cookie for detection users; for example, for the first, I visit your store, you set a cookie with GUID value for me, now when I order something, you use my GUID as an identifier to track my order.