diff --git a/lib/plugins/server/session.js b/lib/plugins/server/session.js index ce751314..445c362e 100644 --- a/lib/plugins/server/session.js +++ b/lib/plugins/server/session.js @@ -75,7 +75,7 @@ var LowLevelPingLoop = {}; var internal_url = base_url_client+"/_internal_/"+page_index; var async_rpc_return = true; - /* If client is safari, we must force rpc to be synchronous */ + /* If client is Safari, we must force rpc to be synchronous */ var hack = typeof(desactivate_safari_hack) == 'undefined' || !desactivate_safari_hack if (hack && !command_line_execution && 'userAgent' in navigator){ var ua = navigator.userAgent; @@ -101,10 +101,10 @@ var LowLevelPingLoop = {}; function generate_cl_id() { var rand = random(); var c = getStableCookie(); - if ( 'none' in c ) - throw new Error("no cookie no session"); + if ('none' in c) + throw new Error('Please make sure cookies are enabled. Cookies are required for sessions.'); else { - return ("" + rand + c.some); + return ('' + rand + c.some); } } @@ -119,7 +119,7 @@ var LowLevelPingLoop = {}; var connection_lost_handlers = null; function default_connection_lost_handler(){ - jlog("Error: the connection with the server seems to be lost. Please reload"); + jlog("Error: Connection lost. Please check your network status and reload the page."); } function break_ping_loop() { @@ -142,14 +142,14 @@ var LowLevelPingLoop = {}; settings.url = domain_url + internal_url + settings.url; if(to_register.length != 0){ var body = settings.data; - if (typeof body == 'undefined') body=""; + if (typeof body == 'undefined') body=''; var data = { to_register:to_register, uri:settings.url, body:body }; settings.data = JSON.stringify(data); - settings.url = internal_url + "/chan/register"; + settings.url = internal_url + '/chan/register'; to_register = new Array(); var success if(settings.success){ @@ -159,7 +159,7 @@ var LowLevelPingLoop = {}; success = function () {} } settings.statusCode = { 205: break_ping_loop, - 200: success}; + 200: success }; } return jQuery.ajax(settings); } @@ -170,8 +170,6 @@ var LowLevelPingLoop = {}; - - /* ************************************************** */ /* Distant Channel ********************************** */ /**