In an environment without third party code, get_the_ID()
should give you the correct value. It sounds like some plugin is interfering with this.
So you can do what they forgot and simply call
wp_reset_postdata()
in your footer before you need the values.