Proper logging-in procedure