added desktop / iphone session logic to login()