I have a list of "online users", which I refresh every 30 seconds with Ajax.PeriodicalUpdater from prototype.js.

There is an issue, that if a user has two tabs/windows open with the site, logs out in one of them, the PeriodicalUpdater is not canceled.

This means that PeriodicalUpdater updates my block element with the entire login page, as I have a restful authentication, that redirects to that.

I am using PHP sessions, and I really cannot get my head straight on this one.

Can any of you guys point me in the right direction?