Cannot modify class property from shortcode handler function

If you are posting from the script to the AJAX handler, that is an entirely different request, the script has no way of knowing the my_var value, so how can it be passed back to the AJAX.

But this is why you are using localize script isn’t it? Why not simply pass the value in that array?

wp_localize_script( 'some_script', 'somescript', array(
        'ajax_url' => admin_url( 'admin-ajax.php' ), 
        'my_var' => $this->my_var 
    )
);