If you become a member or some site that wants to make you navigation easy, they will store your membership info in a Cookie so that you are instantly recognized when you visit the site.
Controlled access can be achieved via a Cookie so that you can't view pages unless you have signed in with a UserID and Password. Usually these cookies expire after you leave the site.
There are many ways a cookie can be used, from simply seeing what pages you visit to allowing you to use an on-line shopping cart! Many people balk at the thought of someone seeing what pages of their website you visit. The consideration most people don't stop for here is that it is the Designers website, why shouldn't he be able to tell what you visit? That way he can improve content on popular pages and remove or enhance un-popular pages.
If a site uses a Cookie then everytime you visit that site, if the browser has a Cookie stored on it, it transfers that Cookie to that site. The program on the site using the Cookie then access the information and acts upon it.
It is important to understand here that a Cookie will only be transfered to the site that created it. Part of the Cookie is the domain name of the site that created it as well as the path to the program that access it. Unless the domain and path match exactly as they were set, the Cookie IS NOT TRANSFERED! There is no way for someone from one site to see the contents of the Cookie from another site. It's just mechanically not possible.
Are Cookies dangerous?NO! As I said, it is a text file and that is all. It is not an executable and can't do anything to your computer!
Consider the following:
Cookies are text files as I've said, they can do nothing except sit on your computers hard drive until called or they expire.