Added credential caching in localStorage