How to Access Data From Cookies
A cookie is a small bit of text that resides on your hard drive. When you navigate to a website, that site can store information in that cookie. This information may include the time of your visit, the pages that you view or products that you purchase. Cookies make it possible for you to automatically log onto some websites. A site simply asks you for your password one time, and when you return, it extracts that password from your cookie. You can view the cookie data that any site places on your hard drive using JavaScript.
Instructions
-
-
1
Launch your browser and navigate to a website.
-
2
Locate the address bar at the top of your browser. This is where you type website URLs.
-
-
3
Type the following JavaScript code into the address bar:
javascript: alert(document.location + " stores the following cookie data ...." + document.cookie)
-
4
Press "Enter." A pop-up message window will open and display the website's URL along with all the cookie data that the site has stored on your hard drive.
-
5
Right-click anywhere in that message window, and select "Copy." Windows will copy the cookie information to the clipboard.
-
6
Open Notepad and create a new document. Right-click anywhere in the document and select "Paste" to paste the data into the document.
-
1
Tips & Warnings
If you see no data after trying this technique, visit another website and try it there. You will not see results if a site does not use cookies.
For security reasons, websites can only store and view data in cookies that they put there. Sometimes the cookie data that you retrieve from a website may not make much sense. Other times, you will be able to recognize useful information. If you clear your browser's cookies, no cookie data will appear until you revisit sites that store cookies.
References
Resources
- Photo Credit Jupiterimages/Brand X Pictures/Getty Images