If you don't click into or talk in the SB for a certain period of time, it logs you out. That period is roughly 10 minutes, I think. When you click into the textbox of the SB, regardless of whether you say anything in the SB, it logs you back in. Therefore, if you've clicked into the textbox within about 10 minutes of bringing up the separate Ajax window, it considers you logged in and pulls your login details from the forum. If you have not clicked into the textbox or spoken in the SB for a time, it has logged you out and requires you to log back into Ajax when you bring up the separate window.
That is, at least, in my experience.