I have an anchor element like this
<a class="head-buttons" href="https://clearsession.bkoo.org">Sign Out</a>
and in my header element, I am setting the cookie like this
ngOnInit() {
document.cookie = "redirect=https://testqa.bkoo.org"
document.cookie = "path=/";
document.cookie = "domain=bkoo.org";
document.cookie = "max-age=-1";
}
What I want to achieve is to send a cookie to https://clearsession.bkoo.org, and the server will read that redirect key in the cookie and will redirect to that URL. However, when I check the cookie in the chrome inspection, the domain=bkoo.org is set as a key value, not as a "Domain". The "Domain" is set as the URL of the application which is testqa.bkoo.org, not bkoo.org. Is there a way to do this on the front end? If I edit my Domain from the Chrome inspector, clearsession.bkoo.org accepts the redirect key from the cookie and it redirects to that URL correctly.
In my old application, the Java controller on the backend sends the response header with the "Set-Cookie:" property but we are getting rid of the JSP shell