简体   繁体   中英

Uniquely identify shopping cart in asp.net web api without logging in

I'm developing shopping cart in asp.net web api. Without user logged in, I'm trying to maintain each user shopping cart separately. And once user is done shopping redirect him to check out.

My question is how to uniquely identify each user shopping cart? I know in MVC , we can use session and store guid and remember user between requests. I also know there are ways to tweak web api to use session .

But is there some built in way to achieve in `web api? I hope the question in clear enough.

You need to persist the guid in database. Pass the guid in header in each request to web api.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM