Added login functionality and session management