Want to change website favicon dynamically?

I have a web application that’s branded according to the user that’s currently logged in. I’d like to change the favicon of the page to be the logo of the private label, but I’m unable to find any code or any examples of how to do this. Has anybody successfully done this before?

I’m picturing having a dozen icons in a folder, and the reference to which favicon.ico file to use is just generated dynamically along with the HTML page. Thoughts?

Here is my website Wishes Universe