Will the public data of the static class be the same for all users in ASp.net MVC?

In the shopping cart, I saved the cart data in a public static class.

Are basket data stored separately for all other customers?

or I'm trying to check out another option for storing the basket.

+4
source share
2 answers

The content of the static class in asp.net will be the same for all clients. You should store items in a session or in any other storage, depending on your requirements (there may be a permanent storage, for example, if you need to)

+2
source

Are basket data stored separately for all other customers?

No. All customers have the same basket. Never store any data in a static class that you need for a specific user. You can use a session for this.

+1
source

Source: https://habr.com/ru/post/1392635/


All Articles