I am trying to make the client receive a page that will set the required cookies after authentication, and then go to another page after setting the cookies.
Client => Server: credentials
Server => Client:
<html>
<body>
<script>
document.cookie="name=myName;path=/;secure;HttpOnly";
document.cookie="token=abcdefg;path=/;secure;HttpOnly";
window.location="https://localhost/myPage.html"
</script>
</body>
</html>
This fails when HttpOnly
is set. How do I fix it?