Bug 72941

Summary: setting cookies from javascript does not work
Product: [Applications] konqueror Reporter: Luciano Montanaro <mikelima>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, rvdboom, scott, spotter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: a simple test case.

Description Luciano Montanaro 2004-01-19 11:55:02 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.2.1 
OS:          Linux

The testcase included does not work in konqueror CVS, even if cookies are apparently enabled. It works fine in mozilla, and in konqueror 3.1
Comment 1 Luciano Montanaro 2004-01-19 11:56:59 UTC
Created attachment 4236 [details]
a simple test case.

Whit javascript enabled, it should print "setCookie() is working".
It currently prints "setCookie() is not working.
Comment 2 David Faure 2004-01-19 15:12:52 UTC
Subject: kdelibs/khtml/html

CVS commit by faure: 

URL() is a KURL now! This broke document.cookies. Will backport.
CCMAIL: 72941-done@bugs.kde.org


  M +4 -4      html_documentimpl.cpp   1.159


--- kdelibs/khtml/html/html_documentimpl.cpp  #1.158:1.159
@@ -97,5 +97,5 @@ DOMString HTMLDocumentImpl::domain() con
 {
     if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
-        m_domain = KURL(URL()).host(); // Initially set to the host
+        m_domain = URL().host(); // Initially set to the host
     return m_domain;
 }
@@ -104,5 +104,5 @@ void HTMLDocumentImpl::setDomain(const D
 {
     if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
-        m_domain = KURL(URL()).host().lower(); // Initially set to the host
+        m_domain = URL().host().lower(); // Initially set to the host
 
     if ( m_domain.isEmpty() /*&& view() && view()->part()->openedByJS()*/ )
@@ -144,5 +144,5 @@ DOMString HTMLDocumentImpl::cookie() con
     QByteArray params, reply;
     QDataStream stream(params, IO_WriteOnly);
-    stream << URL() << windowId;
+    stream << URL().url() << windowId;
     if (!kapp->dcopClient()->call("kcookiejar", "kcookiejar",
                                   "findDOMCookies(QString,long int)", params,
@@ -178,5 +178,5 @@ void HTMLDocumentImpl::setCookie( const 
     fake_header.append(value.string().latin1());
     fake_header.append("\n");
-    stream << URL() << fake_header << windowId;
+    stream << URL().url() << fake_header << windowId;
     if (!kapp->dcopClient()->send("kcookiejar", "kcookiejar",
                                   "addCookies(QString,QCString,long int)", params))


Comment 3 Dirk Mueller 2004-01-21 07:54:40 UTC
*** Bug 73107 has been marked as a duplicate of this bug. ***
Comment 4 Stephan Kulow 2004-01-23 11:36:00 UTC
*** Bug 73290 has been marked as a duplicate of this bug. ***
Comment 5 Stephan Kulow 2004-02-01 10:08:35 UTC
*** Bug 73933 has been marked as a duplicate of this bug. ***
Comment 6 Stephan Kulow 2004-02-01 10:09:18 UTC
*** Bug 72193 has been marked as a duplicate of this bug. ***
Comment 7 Maksim Orlovich 2004-02-10 00:29:18 UTC
*** Bug 74766 has been marked as a duplicate of this bug. ***