Refactored login / implemented session storage