I have a hook_form_user_profile_form_alter (hook_form_FORM_ID_alter) where I'm capturing user information that was changed when a user updates their profile.
I want some of that information available in hook_user_update, which is called after the form alter - maybe no more than 6 fields.
Is there a way to hold some of the information from the hook_form so it is available when I get to hook_user_update? I'm looking for a server side solution. In Java I could use class variables or session storage. I see PHP has session storage. Is that the best practice or is there's a Drupal specific solution or a better PHP usage pattern?
Since someone will probably ask why I don't perform what I need done in hook_form_user_profile_form_alter: That function gets called twice (which can be problematic) and I cannot be sure that the transaction is complete until I get to hook_user_update. So I feel that hook_user_update is a much better place to execute what I need to execute, because I'm synchronizing information with another application. I need to be sure the transaction went through before I perform the call to the other app.