12

Are cookies preserved while doing windows.location(url), if domain of url is the domain of the current page?

Esteban Küber
  • 36,388
  • 15
  • 79
  • 97
Nullpoet
  • 10,949
  • 20
  • 48
  • 65

2 Answers2

15

To be really pedantic, changing window.location in Javascript will cause the browser to go to another site, which includes making a GET request. In other words, a GET request and Javascripts window.location are two completely different things; one is a type of HTTP request, the other a DOM attribute.

As pertains to the question though, they can be considered equivalent. Cookies are preserved.

</pedantry> :)

deceze
  • 510,633
  • 85
  • 743
  • 889
10

Yes. It's the same thing and it will retain all cookies.

this. __curious_geek
  • 42,787
  • 22
  • 113
  • 137