Hmmm... I'm not convinced you can use Javascript to do this effectively as the user simply disables Javascript and they see your page anyhow.
The best way you could get around this is by putting your member pages in a subdirectory with an unguessable name and then use a public page with a Javascript redirect if the cookie is set correctly.
However, if you add Javascript to a page that tests for the cookie and then redirects if they're not logged in so as to "hide" the page content the user just disables Javascript and they see the page anyhow.
I'm a fan of PHP as it's server side and I can choose not to send the page contents with a few lines of PHP.
This is largely why I'll advocate using PHP for doing these things but I only see weaknesses with a Javascript solution.