Add IsLoggedIn API function for keeping sessions