Added support for persistent sessions.

Added support for persistent sessions. Authenticated session is stored locally and only re-authenticates when session expires.