We have HTML5 now! Just create a HTML session or a php $COOKIE and control your javascript functions with a simple if statement.
WEB STORAGE
localStorage.setItem("is_logged_in", var);
if(is_logged_in){
//all of your functions in here
}
You can read more here http://www.w3schools.com/html/html5_webstorage.asp
PHP
Easier way and personally my favorite is using PHP.
$var = "is_logged_in";
setcookie($var , time() + (86400 * 30), "/")
And then for the check:
<?php if(isset($_COOKIE[$var])) { ?>
//all of your functions in here
<?php } ?>
You can read more here http://www.w3schools.com/php/php_cookies.asp
EDIT
And ofcourse you can always instead of having a huge if statement you can disable all controls in a very smaller if.
<?php if(isset($_COOKIE[$var])) { ?>
$('button').attr('disabled', 'disabled');
<?php } ?>