[prev in list] [next in list] [prev in thread] [next in thread]
List: konq-bugs
Subject: Bug#36624: document.cookie fails in Konqueror
From: djoham () yahoo ! com
Date: 2001-12-29 23:36:07
[Download RAW message or body]
Package: kjs
Version: KDE 2.2.2
Severity: normal
Installed from: Mandrake RPMs
Compiler: Not Specified
OS: Linux
OS/Compiler notes: Not Specified
Hello,
I'm trying to develop a library that will allow developers to save XML data to the \
client's hard drive for use later in an off line session.
I'm trying to use cookies as the storage mechanism. However, when I try to use \
document.cookie, Konqueror always returns back an empty string and never sets the \
cookie.
Please see below for a recreation. In IE and Netscape (both 4.x and 6.x), you can set \
a cookie, exit the browser and then come back. When you do, the cookie is still \
there. Konqueror does not allow this.
Thanks for your attention.
<HTML>
<BODY BGCOLOR="WHITE">
<FORM NAME="frmDocObject" ID="frmDocObject">
Welcome to this page. The time is
<SCRIPT LANGUAGE="javascript">
var theTimeIs = new Date();
document.write(theTimeIs.toString());
document.write("<BR><BR>");
</SCRIPT>
Cookie Name:<BR>
<INPUT TYPE="TEXT" NAME="txtCookieName" ID="txtCookieName"><BR>
<BR>
Cookie Value:<BR>
<INPUT TYPE="TEXT" NAME="txtCookieValue" ID="txtCookieValue"><BR>
<BR>
<INPUT TYPE="BUTTON" NAME="cmdSetCookie" ID="cmdSetCookie" VALUE="Set Cookie" \
onClick="setCookie()"> <INPUT TYPE="BUTTON" NAME="cmdShowCookie" ID="cmdShowCookie" \
VALUE="Show Cookie Value" onClick="showCookie()">
<INPUT TYPE="BUTTON" NAME="cmdShowAllCookies" ID="cmdShowAllCookies" \
VALUE="Show All Cookies" onClick="alert(document.cookie)">
</FORM>
</BODY>
</HTML>
<SCRIPT LANGUAGE="javascript">
function setCookie(){
var x = new Date();
var z = x.getFullYear() + 10;
var y = new Date("January 01, " + z);
document.cookie = document.frmDocObject.txtCookieName.value + "=" + \
escape(document.frmDocObject.txtCookieValue.value) + " ;expires=" + y.toGMTString();
}
function showCookie(){
var myCookie = " " + document.cookie + ";";
var cookieName = " " + document.frmDocObject.txtCookieName.value;
var cookieStart = myCookie.indexOf(cookieName);
var cookieEnd;
if (cookieStart != -1){
cookieStart += cookieName.length;
cookieEnd = myCookie.indexOf(";", cookieStart);
}
alert(unescape(myCookie.substring((cookieStart+1), cookieEnd)));
}
</SCRIPT>
(Submitted via bugs.kde.org)
_______________________________________________
Konq-bugs mailing list
Konq-bugs@mail.kde.org
http://mail.kde.org/mailman/listinfo/konq-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic