For convenient notification purposes, not secure information purposes:
I have javascript polling for new information while logged in. I want it to stop while logged out. What is the best way to let javascript know about the logged-in/logged out status?
Run a javascript function on login, and one on logout (which might get skipped if they navigate away and come back directly)? Run a poll periodically to check for access to secure (logged-in-only) information and skip further polls if that access isn't available? Another option that I haven't found yet?
I'm running php server-side, if matters.