I want to save cookie in Google Chrome. I wrote code which works in Firefox but not in chrome. What is wrong?
What doesn't work?
Does it fail to set, fail to read or both?
I'm guessing it's the reader.
var str = '; '+ document.cookie +';';
var index = str.indexOf('; '+ escape(name) +'=');
This assumes that the wanted data is preceded by "; ", dictating that the first cookie in [FONT="Courier New"]document.cookie[/FONT] will be ignored.
I'm sure you'll want to find your own solution.
Addendum: It seems that the current version of Chrome doesn't set cookies under the file:/// protocol. Other browsers have done this in the past, so you'll have to test it under [url]http://.[/url]