The cookies() method should only return the value of the
authorlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2007 08:46:50 +0000 (08:46 +0000)
committerlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2007 08:46:50 +0000 (08:46 +0000)
        cookie, not additional info such as the expiration date.
        Fixes LayoutTests/fast/cookies/local-file-can-set-cookies.html

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/CookieJarQt.cpp

index 10b4e0e0009e96581bad0aeb68bf50e50ed3784e..a83bede0ce7322c06a7780df6fa51a8681bcc46f 100644 (file)
@@ -1,3 +1,13 @@
+2007-10-02  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Olliej.
+
+        The cookies() method should only return the value of the
+        cookie, not additional info such as the expiration date.
+
+        * platform/qt/CookieJarQt.cpp:
+        (WebCore::cookies):
+
 2007-10-01  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Eric.
index b6c26c1c0237531be4bdfb5b630e2e1c1374cf0d..6344304c8bf66a83a5eb0f1308b0bf397e407144 100644 (file)
@@ -22,7 +22,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -46,7 +46,11 @@ void setCookies(const KURL& url, const KURL& policyURL, const String& value)
 String cookies(const KURL& url)
 {
     QUrl u((QString)url.url());
-    return (String)QCookieJar::cookieJar()->cookies(u);
+    QString cookies = QCookieJar::cookieJar()->cookies(u);
+    int idx = cookies.indexOf(QLatin1Char(';'));
+    if (idx > 0)
+        cookies = cookies.left(idx);
+    return cookies;
 }
 
 bool cookiesEnabled()