How do I convert the following 2 lines of code present in the HTML Head Content section to the JavaScript present in “On Load” event?
"<META HTTP-EQUIV="Refresh" content="1; url=https://www.testdomain.com/secureapp/target.jsp\“>” +
“<META HTTP-EQUIV="Set-Cookie" content="DominoReqURL=http://”+Server_Name+RedirectTo+“; path=/;domain=testdomain.com">”
On Load:
location = window.location;
serverName = location.host;
domainName = “.testdomain.com”;
domainExist=serverName.indexOf(domainName,0);
path = location.pathname;
if (domainExist == -1) {
newURL= “http://” + serverName + domainName + path;
window.location.replace( newURL );
document.cookie = DominoReqURL + " = " + newURL +“; path=” + path + " ; domain= " + domainName;
}
document.cookie = DominoReqURL + " = " + serverName +path + “; path=” + path + " ; domain= " + domainName;
loginURL = “https://www.testdomain.com/secureapp/target.jsp”;
window.location.replace( loginURL );
I have tried the above code, the redirection to the JSP page is working fine but the cookie is not getting set in the browser. When I put the alert box for Document.cookie, it displays the empty dialog box and even if I hard code something like
document.cookie = “DominoReqURL=” + newURL, the alert shows the value but when the request gets redirected to the JSP page, the client (IE browser)doesn’t have the cookie in it.
Can anybody help to pass the cookie information alongwith the redirect request?
Regards,
Somu.