Web Browser and Servers use HTTP protocol to communicate. HTTP is a stateless protocol. But for a commercial website it is required to maintain session information among different pages. Cookies are bits of data that a browser stores in visitor’s computer. When a web server has sent a web page to a browser, the connection is shut down, and the server forgets everything about the user. Cookies were invented to solve this problem.