how to use cookie to protect other node pages in Drupal
Sounds like a case for user authentication?

The problem is the first page request will never have a server-side set cookie as it will be set on the subsequent request and you don't want to deny access on your homepage.

You could set the cookie with javascript, but then you risk blocking users with js disabled.

Requiring user login would be the easiest solution.