hook_boot and Varnish
If you use Varnish - you must consider that for anonymous users PHP code will not execute at all - they will retrieve only static HTML.

In you case solution can be as following:


On welcome page set cookie by JavaScript not PHP.
Using Varnish vcl script check if user loads homepage and has cookie. If not - then redirect it to welcome page. 


Now item #2 is made in PHP code but you need rewrite it using Varnish.
You can also write item #2 using JavaScript but it will work much slower and user will see browser redirection.