More changes to get new server (lexos) working. Removed document.cookie, replaced with ajax calls