
A Cookie is a type of message which is given to a Web browser by a Web server with a main purpose to identify users and prepare customized Web pages or to save site login information. When the user gains entry into a Web site using cookies, they may be asked to fill out a form providing personal information, such as their name, e-mail address, and other interests.
This information is then packaged into a cookie and sent to their Web browser, which is thereby stored for later use. When the same Web site is later visited, the browser will send the cookie to the Web server. The message is sent back to the server each time the browser requests a page from the server.Hence, Cookies are messages that a Web server transmits to a Web browser so that the Web server can keep track of the user’s activity on a specific Web site.

Types of Cookie:
Session Cookie: This is also called a transient cookie, a cookie which is erased when the Web browser is closed. Stored in temporary memory, the session cookie is not retained after the browser is closed does not collect information from your computer. Informationis typically stored in the form of sessionidentification, where the user is not personally identified.
Persistent Cookie: This is also called a permanent cookie or a stored cookie. It is stored on your hard drive until it expires and are set with expiration dates or until the cookie gets deleted. These cookies are used to collect the user’s identity information, such as Web surfing behaviour or user preferences for a specific Web site.
