1var cookieName = 'idsrv.session'; 2var intialSessionId = getBrowserSessionId(); 3var interval = setInterval(() => { 4 if (intialSessionId !== getBrowserSessionId()) { 5 window.location.href = getRedirectUrlOrigin(); 6 } 7}, 3000); 8 9document.getElementById('loginForm').addEventListener('submit', () => { 10 clearInterval(interval); 11}) 12 13function getBrowserSessionId() { 14 var cookies = getCookies().filter(function (cookie) { 15 return (cookie.name === cookieName); 16 }); 17 // empty string represents anonymous sid 18 return (cookies[0] && cookies[0].value) || ''; 19} 20 21function getCookies() { 22 var allCookies = document.cookie; 23 var cookies = allCookies.split(';'); 24 return cookies.map(function (value) { 25 var parts = value.trim().split('='); 26 if (parts.length === 2) { 27 return { 28 name: parts[0].trim(), 29 value: parts[1].trim() 30 }; 31 } 32 }).filter(function (item) { 33 return item && item.name && item.value; 34 }); 35} 36 37function getRedirectUrlOrigin() { 38 let res = '/account/loggedout'; 39 let returnUrl = findQueryParamIgnoreCase(window.location.search, 'returnurl'); 40 if (returnUrl) { 41 let redirectUri = findQueryParamIgnoreCase(returnUrl.slice(returnUrl.indexOf('?'), returnUrl.length), 'redirect_uri'); 42 if (redirectUri) { 43 let idx = redirectUri.indexOf("/", redirectUri.indexOf("//") + 2); 44 res = redirectUri.substr(0, idx); 45 } 46 } 47 return res; 48} 49 50function findQueryParamIgnoreCase(paramsStr, param) { 51 let searchParams = new URLSearchParams(paramsStr); 52 let entry = Array.from(searchParams.entries()).find(([k, _]) => k.toLowerCase() == param.toLowerCase()); 53 return entry != undefined ? entry[1] : null; 54}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.