What are cookies?
Cookies are essentially pieces of code saved by websites onto the user’s web browser when a session is initiated. Cookies have a lot of uses but the most important ones are session management, user personalization, and tracking.
A cookie is a small file of letters and numbers downloaded on to your computer when you access certain websites. Like virtual door keys, cookies unlock a computer’s memory and allow a website to recognize users when they return to a site by opening doors to different content or services. Like a key, a cookie itself does not contain information, but when it is read by a browser it can help a website improve the service delivered.
What are the advantages and disadvantages of cookies?
Advantages Of Cookies:-
• Persistence: one of the most powerful aspects of cookies is their persistence. If a cookie is installed in the client’s browser, it can take days, months or even years. This makes it easy to save user preferences and visit information and keep this information available each time the user returns to your site. Since cookies are stored on the client’s hard drive, they are always available in case of server failure.
• Transparent: Cookies work transparently without the user knowing that the information needs to be stored.
• Free up memory on the server.
• Cookies are simple to use and implement.
Disadvantages Of Cookies:-
• Sometimes, customers disable cookies in their browsers in response to security or privacy concerns that cause problems for web applications that need them. • Individual cookies can contain a very limited amount of information (no more than 4KB).
• Cookies are limited to single string information. You cannot record complex information. • Cookies are easily accessible and readable when the user finds them and opens them again.
• Most browsers limit the number of cookies that a single domain can set to a maximum of 20 cookies (except Internet Explorer). If you try to set more than 20 cookies, the oldest cookies will be automatically deleted.