Fixing #939

applied conditional calls to getCookieStringSync as well as  setCookieSync in request.js, where the actual cookie-reading / cookie-writing happens.