buddycloud/webclient — pull request #61 by denisw (2012-10-12 13:19:01+00:00)
Title: Login improvements

This branch implements two improvements:

- **Make login work across tabs.** The way this works is that the credentials are saved in `localStorage` with a `loginCount`, which acts like a reference count: `User#login()` increases it by one, while the new `User#logout()` does the opposite. If a tab is closed and the count drops to zero, the credentials are removed from `localStorage`. Saving to `sessionStorage` is still done so that the credentials survive a page reload (which would otherwise result in the credentials being thrown away because reloading also fires a close event).

- **Implement the "Stay logged in" option** with a `localStorage. loginPermanent` flag.