You need to nest the if statement in the onreadystatechange function. reason for this is because the value of readyState changes value from 0 to 4. responseCode will be null until readyState is at least 2. What is happening is your IF statement is triggered many times, and the PSM has flood protection as to how often it can be updated. you want the PSM to be updated only once, but with your code it happens multiple times.Take a look at my tutorial again.
EDIT: ok, yes that was posted below. I would still recommend changing the function though.
When you are saying that you aren't authenticated on the site, what are you doing to test that? Is the script getting more information from the site, or are you opening a web browser? My best guess is that once your browser session ends, the site trashes your authentication status. If you are using the script to fetch more information, keep re-using the same XMLHTTP object, and don't re-declare it. meaning, this line should only appear once in the script:
code:
var webAuth = new ActiveXObject("Microsoft.XMLHTTP");
Post some more details of what you are trying to do.