Is window.location() same as a GET request?
Asked Answered
P

2

13

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

Pyrology answered 24/12, 2009 at 12:34 Comment(0)
D
10

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

Disposition answered 24/12, 2009 at 12:36 Comment(0)
I
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> :)

Imf answered 29/3, 2010 at 12:11 Comment(1)
+1 for satisfying my semantics teacher back in philosophy 101.Coolant
D
10

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

Disposition answered 24/12, 2009 at 12:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.