that suggestion should work too.
it relies on setting a cookie named "secret-cookie".
you could create a password protected page on your site, an use Cookies toolkit to create the cookie when you access that page, this way, the cookie can only be set if you are able to login.