| Author: Pradeep Kumar Chaudhary 31 Aug 2008 | Member Level: Gold | Rating: Points: 6 |
You create a new cookie by adding a cookie to the Response.Cookies collection.The Response.Cookie collection contains all the cookies sent to the web server to the web browser.
You can't really use a cookie to store a shopping cart. A cookie is just too small and too simple. To enable you to work around the limitations of the cookies, the ASP.NET Framework supports a feature called Session state. Like cookies, items stored in Session state to store user preferences or other user-specific data across multiple page requests. Unlike cookies, Session state has no size limitations. If you had a compelling need, you could store gigabytes of data in the Session state. Furthermore, unlike cookies, Session state can represent more complex objects than simple strings of text. You can store any object in Session state. For example, you can store a DataSet or a custom shopping cart object in Session state. You add items to Session state by using the Session object.
Regards, Pradeep
|