Closed Bug 5250 Opened 25 years ago Closed 25 years ago

setting document.cookie using javascript causes an abort.

Categories

(Core :: Networking: Cookies, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: sdm, Assigned: morse)

References

()

Details

This sample code causes an abort, atleast under linux: // Sets cookie values. Expiration date is optional // function setCookie(name, value, expire) { document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) } function register(name) { var today = new Date() var expires = new Date() expires.setTime(today.getTime() + 1000*60*60*24*365) setCookie("TheCoolJavaScriptPage", name, expires) } I've tried taking out all the extraneous stuff here, except for the document.cookie = stuff, and it still dumps core.
Assignee: norris → morse
Component: JavaScript → Cookies
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
Using a tree that I pulled and built on April 16, I was unable to reproduce this problem. I ran it on both windows and on linux and the cookie was successfully set in both cases and there was no abort or crash on either platform. Here is the exact html that I used: <html> <head> <script> function setCookie(name, value, expire) { document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) } function register(name) { var today = new Date() var expires = new Date() expires.setTime(today.getTime() + 1000*60*60*24*365) setCookie("TheCoolJavaScriptPage", name, expires) } register("cookie1"); </script> </head> <body> Javascript cookie-setting bug </body> </html>
Sorry, I forgot to mention one important thing - this was in a XUL document, not HTML. The xul I was using is at http://pimpmaster.org/simeon/xultool-test?create=xul
Sorry, this one doesn't crash either. Again I tried it in both windows and linux. Furthermore, it does not set any cookies. I tried it in 4.5 and it ran fine once. But the next time I tried it I got something very strange -- rather than displaying a page it attempted to download a file called xultool-text.htm. I exited and reentered the browser and the same thing happened. Furthermore, that htm file contains no cookie-setting code. Status uncanged -- it still works for me. I'm assuming that whatever problem you are running into, it has been corrected in the later version of the sources. You might want to pull a fresh tree and see if you are still having the problem.
Status: RESOLVED → VERIFIED
smorrison, can you reproduce the problem? smorse has stated above that he is unable to reproduce it here, and i have been unsuccessful in reproducing the problem as well. if you can reproduce it, please reopen it.
You need to log in before you can comment on or make changes to this bug.