use the user object instead of session object to check if user is
logged in
fixed user login check

use the user object instead of session object to check if user is
logged in