What are benefits and limitations of using Cookies?
The benefits of using cookies for state management are as follows:-
1) There is no server resources required as they are stored in client.
2) They are light in weight and simple to use
The limitation of using cookies is as follows:-
1) The Most browsers place a 4096-byte limit on the size of a cookie, although support for 8192-byte cookies is becoming more general in the new browser and client-device versions available today.
3) The Cookies can be tampered and thus creating a security hole.
4) The Cookies can expire thus leading to inconsistency.
Below is sample code of implementing cookies
Request.Cookies.Add(New HttpCookie("name", "user1"))