How to delete user on logout and when session expires?

So this is what I did…also keep in mind this is for a multisite and I am call calling this within a class. ‘Client’ is a custom user role that is create and given to users when they are created.

   function delete_user() {
        global $current_user;

        if(in_array('client', $current_user->roles )){
            if(!function_exists('wp_delete_user')) {

                include(ABSPATH . "wp-admin/includes/ms.php");
            }
            wpmu_delete_user( $current_user->ID );
        }
    }
add_action('clear_auth_cookie', 'delete_user');

I do have one question…this works when the user logs out, but when will it run on its own. When the cookie times out?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)