+var USERNAME_COOKIE = 'meye_username';
+var PASSWORD_COOKIE = 'meye_password_hash';
+
 var pushConfigs = {};
 var pushConfigReboot = false;
 var refreshDisabled = {}; /* dictionary indexed by cameraId, tells if refresh is disabled for a given camera */
     document.cookie = name + '=' + value + '; ' + expires + '; path=/';
 }
 
-function remCookie(name) {
-    document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
-}
-
 function showErrorMessage(message) {
     if (message == null || message == true) {
         message = 'An error occurred. Refreshing is recommended.';
 }
 
 function doLogout() {
-    setCookie('username', '_');
+    setCookie(USERNAME_COOKIE, '_');
     window.location.reload(true);
 }
 
                 window._loginDialogSubmitted = true;
                 
                 if (rememberCheck[0].checked) {
-                    setCookie('username', window.username, /* days = */ 3650);
-                    setCookie('passwordHash', window.passwordHash, /* days = */ 3650);
+                    setCookie(USERNAME_COOKIE, window.username, /* days = */ 3650);
+                    setCookie(PASSWORD_COOKIE, window.passwordHash, /* days = */ 3650);
                 }
                 
                 form.submit();
         window.basePath = splitUrl(qualifyPath('')).baseUrl;
 
         /* restore the username from cookie */
-        window.username = getCookie('username');
-        window.passwordHash = getCookie('passwordHash');
+        window.username = getCookie(USERNAME_COOKIE);
+        window.passwordHash = getCookie(PASSWORD_COOKIE);
     }
     
     /* open/close settings */