login and logout with localForage