Cleanup getCookie() and use it all over the place instead of using $_COOKIE directly