Two helper methods have been added to Application controller.

current_user will return the current user IF there is a valid session.
logged_in? returns boolean value depending on the return value of current_user.