A web server transmits certain messages to a web browser so that the web server can monitor the user’s activity on a particular website, the messages are known as cookies. It is a small piece of information that a website stores on your computer, and uses it at the time of your iteration on that website. When you visit the website again, your browser sends information back to the site.
- The web browser stores the message/information in a text file, the message/information then sent back to the server each time the browser request a page from the server.
- The main aim of cookies is to identify users and perhaps prepare customized Web pages for them.
- The name cookie is derived from UNIX objects called magic cookies. These are the tokens that are attached to a user or program and switch depending on the areas entered by the user or program.
- Cookies do not act maliciously on computer systems i.e., they are only a text files that can be deleted any time- they are not plugins, nor they program.
- Cookies cannot be used to spread viruses, and they cannot access your hard drive.
Cookies can not read your hard drive to find out information about you, however, any personal information that you give to a website, including credit or debit card information, will most likely be stored in a cookie unless you have turned off the cookies a threat to privacy. The cookie will only contain information that you freely provide to a Website.
Do not give your credential information on a non-trusted websites or web pages. It may loss your data and information.
Uses of Cookies :
- Session management – Cookies let websites allow users and recollect their individual login information and preferences.
- Personalization – It is a customized advertising which is the main way cookies are used to personalize your sessions.
Parameter for Cookies :
Cookies have six parameters that can be passed to them :
- Name of the cookie – Determines the name of the cookie.
- Value of the cookie – Determines the value of the cookie.
- Expiration date of the cookie – determines how long the cookie will remain active in your browser.
- Valid path for the cookie – This sets the URL path in which the cookie is valid. Web pages or websites outside to the path of cookie cannot use the cookie.
- Valid domain for the cookie – This takes the path parameter one step farther. This makes the cookie accessible to pages on any of the servers when a site uses multiple servers in a domain.
- Need for a secure connection – It specifies that a cookie can only be used under a secure server condition, such as a site using SSL.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.