When trying to get data within an instance of a plugin, all of the PHP methods defined in our plugin class file can "see" the data that was just set for a certain property.
However, when we create a PHP method that responds to an AJAX post request from the JavaScript file in our plugin, all of a sudden that property is just empty as if it's never been set.
Accessing it from any other method works fine, so it leads me to believe that the AJAX-callable method is seeing a different context of $this which hasn't had the property set yet.
Is this likely the case? Or is something else afoot?
Edited for clarity:
The data in question is set at run-time via a parameter in the shortcode that kickstarts the main functionality. So it doesn't exist until the shortcode is executed which got me wondering if the way AJAX calls the method exists in a different context than the plugin object created by WordPress on page load.