Cookies enable you to store the session information on the client side which has the following advantages,
• Persistence: One of the most powerful aspects of cookies is their persistence. When a cookie is set on the client’s browser, it can persist for days, months or even years. This makes it easy to save user preferences and visit information and to keep this information available every time the user returns to your site. Moreover, as cookies are stored on the client’s hard disk so if the server crashes they are still available.
• Transparent: Cookies work transparently without the user being aware that information needs to be stored.
• They lighten the load on the server’s memory.
Disadvantages of Cookies
The following are the disadvantages of cookies :
• Sometimes clients disable cookies on their browsers in response to security or privacy worries which will cause problem for web applications that require them.
• Individual cookie can contain a very limited amount of information (not more than 4 kb).
• Cookies are limited to simple string information. They cannot store complex information.
• Cookies are easily accessible and readable if the user finds and reopens.
• Most browsers restrict the number of cookies that can be set by a single domain to not more than20 cookies (except Internet Explorer). If you attempt to set more than 20 cookies, the oldest cookies are automatically deleted.