Static variable scope in drupal
Static variables are initialised once per page build. As soon as you refresh the page you'll lose any vars declared in your page build, including static ones.

If you want to persist data between page loads you need to use session storage