Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order of keys in Cookies JS vs ASP

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Hello,

Can anyone explain why a cookie with a bunch of keys (no pun intended) when retrieved with javascript is in a different key order compared to that same cookie when retrieved with ASP?

e.g.

JS returns: key1=A&key2=B&key3=C&key4=D&key5=E

ASP returns: key5=E&key2=B&key3=C&key1=A&key4=D

All the data is certainly there, but it makes it more complex to parse it.

Any thoughts or solutions on how to prevent/fix it would be appreciated. Steve Davis
hey.you@hahaha.com.au
 
It should only be a problem if you're referencing them by ordinals.

And by Javascript I assume you're talking client-side, not server-side Javascript ASP? codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
<insert witticism here>
 
Yes, it is client-side JS.

The source of the problem is that I am retrieving some info from the cookie to repopulate a form if the user has placed an order in the past.

My client hasn't made the jump to a databse driven site yet ...sigh... which would make life sooooo much easier.

The cookie is set using Javascript but retrived using ASP. Sure, I can set teh whole hting up to grab the correct value from wherever it is in the retrived string, but it would have been nice to simply sep up a for-next loop.

Thanks for the reponse
Steve Davis
hey.you@hahaha.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top