0

I have an issue that should be fixed on the server side, but a quick workaround on the client side would be acceptable.

I need to make a JS call after the page is loaded and the http-only secure cookie is already set. I'm using window.onload event to call window.location.replace(), but even though the page is loaded with the SET-COOKIE HTTP response header, the new request doesn't send the cookie.

How to make sure the Cookie is set before a new request is made?

Community
  • 1
  • 1
Ricardo
  • 3,696
  • 5
  • 36
  • 50

1 Answers1

0

A workaround that works for Chrome, FF and IE8+ is to use a setTimeout() inside the window.onload event handler. I'm looking for a better solution and an explanation, though...

Thanks,

Ricardo
  • 3,696
  • 5
  • 36
  • 50