Bug 72941 - setting cookies from javascript does not work
Summary: setting cookies from javascript does not work
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 72193 73107 73290 73933 74766 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-19 11:55 UTC by Luciano Montanaro
Modified: 2007-05-17 21:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
a simple test case. (1.42 KB, text/html)
2004-01-19 11:56 UTC, Luciano Montanaro
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***