Hello,
Is it possible to force a user to be logged out in a public portal before the form loads? We're looking into the possibility of doing internal anonymous surveys and feedback forms in a 10.4 public portal. I've tried using JavaScript to check for a session ID and to run the logout function through that, however I can't seem to get it working, if this is even the way to go.
$(document).ready(function() { console.log("All cookies:", document.cookie); function checkCookie(name) { var cookieArr = document.cookie.split(";"); for (var i = 0; i < cookieArr.length; i++) { var cookiePair = cookieArr[i].split("="); if (name === cookiePair[0].trim()) { console.log("Cookie found:", name); return true; } } console.log("Cookie not found:", name); return false; } var sessionCookieName = 'ASP.NET_SessionId'; var shouldLogout = checkCookie(sessionCookieName); if (shouldLogout) { console.log("User is logged in."); var currentUrl = window.location.href; console.log("Current URL:", encodedUrl); var encodedUrl = encodeURIComponent(currentUrl); window.location.href = 'redacted' + encodedUrl; } else { console.log("User is not logged in."); } });
I saw in this thread that you can achieve this after the form has been submitted, so I'm hoping there's some method of doing this before the form loads. Thank you in advance for any assistance