Reputation: 1546
I want to create shopping cart without using session variable to avoid load on Server.
What is an alternative of session variable for shopping cart in asp.net MVC?
Upvotes: 12
Views: 2478
Reputation: 1975
If you want to save some load on your DB as well you could give it try to save the cart in the page itself. Just serialize the cartinformation and store it in a hiddenfield. Very simple and server load effective. The drawback is that that the cart is not remembered for next visit. But for anonymous users it works well. I have done it successfully on various ecommerce sites.
Upvotes: 1
Reputation: 3131
thats a good question
i think you can try for storing shopping cart in cookie ..
it will increase performance and provide less load on server ...
Upvotes: 3
Reputation: 60486
Then you need to do this using a cookie
.
Just to make it clear, your shopping cart unique id should be a System.Guid
not an int
Upvotes: 6