Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Again, I am new to the programming and security world. I should mention that it is just a theoretical question so I can anticipate this kind of attack.

Using javascript, is it possible to iterate through all cookies saved in the user browser and send them to me?

share|improve this question
up vote 5 down vote accepted

You can only iterate through cookies associated with the site the javascript is executing from. And you can only iterate through cookies that are not marked as server only (newer browsers only though).

This is a form if Cross Site Scripting (XSS).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.