[BlackBerry] Sign in cookie for ESPN.com does not retain login account (for fantasy...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 13:14:08 +0000 (13:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 13:14:08 +0000 (13:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83760

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-04-13
Reviewed by George Staikos.

.:

* ManualTests/blackberry/http-cookie-database-set.php: Added.
* ManualTests/blackberry/http-cookie-database-update.php: Added.

Source/WebCore:

When we update cookies' database, protocol shouldn't be checked since it is not a cookie's key.
ESPN.com's https cookies should replace old http cookies if they have the same keys(name, path, domain).

We must restart the browser to test, so have to write a manual test case.

Test: ManualTests/blackberry/http-cookie-database-set.php

* platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
(WebCore::CookieDatabaseBackingStore::invokeOpen):

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

ChangeLog
ManualTests/blackberry/http-cookie-database-set.php [new file with mode: 0644]
ManualTests/blackberry/http-cookie-database-update.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp

index 49fecff..1d02f3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-04-13  Jason Liu  <jason.liu@torchmobile.com.cn>
+
+        [BlackBerry] Sign in cookie for ESPN.com does not retain login account (for fantasy sports).
+        https://bugs.webkit.org/show_bug.cgi?id=83760
+
+        Reviewed by George Staikos.
+
+        * ManualTests/blackberry/http-cookie-database-set.php: Added.
+        * ManualTests/blackberry/http-cookie-database-update.php: Added.
+
 2012-04-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
 
         [EFL] Add API for color chooser
diff --git a/ManualTests/blackberry/http-cookie-database-set.php b/ManualTests/blackberry/http-cookie-database-set.php
new file mode 100644 (file)
index 0000000..223f52c
--- /dev/null
@@ -0,0 +1,14 @@
+<?php if (isset($_COOKIE["db_cookie"])) {
+              if ($_COOKIE["db_cookie"] == "https_cookie")
+                  echo 'PASS';
+              else
+                  echo 'FAIL';
+      } else {
+          header("Set-Cookie: db_cookie = http_cookie; expires=Thu, 12-Apr-2312 08:32:29 GMT;");
+          $path = str_replace("http-cookie-database-set.php", "http-cookie-database-update.php", $_SERVER["PHP_SELF"]);
+          $newurl = 'https://'.$_SERVER["HTTP_HOST"].$path;
+          $location = 'Location:'.$newurl;
+          header($location);
+      }
+?>
+
diff --git a/ManualTests/blackberry/http-cookie-database-update.php b/ManualTests/blackberry/http-cookie-database-update.php
new file mode 100644 (file)
index 0000000..42a5248
--- /dev/null
@@ -0,0 +1,9 @@
+<?php 
+       header('Set-Cookie: db_cookie = https_cookie; expires=Thu, 12-Apr-2312 08:32:29 GMT;');
+       echo 'Test updating of cookies\' database. It is for https://bugs.webkit.org/show_bug.cgi?id=83760.<br>';
+       echo 'To run this test, http-cookie-database-set.php must be served over http and http-cookie-database-update.php must be served over https.<br>';
+       echo 'Test steps:<br>';
+       echo '1. Load http-cookie-database-set.php. (If you load http-cookie-database-update.php directly in this step, please clear cookies and load http-cookie-database-set.php to finish this step.<br>';
+       echo '2. Restart the browser and load http-cookie-database-set.php again to see the result.<br>';
+
+?>
index 2dff950..b11794e 100644 (file)
@@ -1,3 +1,20 @@
+2012-04-13  Jason Liu  <jason.liu@torchmobile.com.cn>
+
+        [BlackBerry] Sign in cookie for ESPN.com does not retain login account (for fantasy sports).
+        https://bugs.webkit.org/show_bug.cgi?id=83760
+
+        Reviewed by George Staikos.
+
+        When we update cookies' database, protocol shouldn't be checked since it is not a cookie's key.
+        ESPN.com's https cookies should replace old http cookies if they have the same keys(name, path, domain).
+
+        We must restart the browser to test, so have to write a manual test case.
+
+        Test: ManualTests/blackberry/http-cookie-database-set.php
+
+        * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
+        (WebCore::CookieDatabaseBackingStore::invokeOpen):
+
 2012-04-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         [Qt] Use QQuickFlickable::setPixelAligned instead of doing pixel-alignment when rendering.
index b27003a..a76c041 100644 (file)
@@ -238,7 +238,7 @@ void CookieDatabaseBackingStore::invokeOpen(const String& cookieJar)
     String updateQuery("UPDATE ");
     updateQuery += m_tableName;
     // The where statement is chosen to match CookieMap key.
-    updateQuery += " SET name = ?1, value = ?2, host = ?3, path = ?4, expiry = ?5, lastAccessed = ?6, isSecure = ?7, isHttpOnly = ?8, creationTime = ?9, protocol = ?10 where protocol = ?10 and name = ?1 and host = ?3 and path = ?4;";
+    updateQuery += " SET name = ?1, value = ?2, host = ?3, path = ?4, expiry = ?5, lastAccessed = ?6, isSecure = ?7, isHttpOnly = ?8, creationTime = ?9, protocol = ?10 where name = ?1 and host = ?3 and path = ?4;";
     m_updateStatement = new SQLiteStatement(m_db, updateQuery);
 
     if (m_updateStatement->prepare()) {