WASReqURL
cookie that is set to remember the URL to a protected resource when there is no User session active. WAS redirects to the Login page and remembers the previously called URL in the WASReqURL
. Via a small JavaScript on the login page, we modify this cookie to point to the My Page url. The login page is defined in dboard.war/auth/login.jsp
. Add the following snippet to the head scripts of the file.function setRedirectCookie(){
var cookieName = "WASReqURL";
var requestURL = getCookie(cookieName);
if(requestURL.substr(requestURL.length - 9) == "homepage/") {
requestURL += "web/widgets";
}
setCookie(cookieName, requestURL, null, "/");
}
The
getCookie()
and setCookie()
methods are copied from the example on w3schools. Note, that the setCookie()
method uses a fourth parameter, which is the path that is simply appended after the expires parameter. The setRedirectCookie()
method retrieves the WASReqURL
and checks if it ends with "homepage/" - which is the Updates page. If thats the case, the "web/widgets" is appended, pointing to the My Page.