plugin crash with default wordpress function

this plugin crash with default wordpress function is_user_logged_in()
if is_user_logged_in() written in my code, always logout.

so what function for checking is user logged in or not?