-static QString stripDomain( KHttpCookiePtr cookiePtr)
+QString KCookieJar::stripDomain( KHttpCookiePtr cookiePtr)
{
QString domain; // We file the cookie under this domain.
if (cookiePtr->domain().isEmpty())
@@ -531,6 +539,13 @@ void KCookieJar::extractDomains(const QS
{
if (partList.count() == 1)
break; // We only have a TLD left.
+
+ if ((partList.count() == 2) && (m_twoLevelTLD[partList[1].lower()]))
+ {
+ // This domain uses two-level TLDs in the form xxxx.yy
+ break;
+ }
+
if ((partList.count() == 2) && (partList[1].length() == 2))
{
// If this is a TLD, we should stop. (e.g. co.uk)
@@ -543,14 +558,6 @@ void KCookieJar::extractDomains(const QS
QCString t = partList[0].lower().utf8();
if ((t == "com") || (t == "net") || (t == "org") || (t == "gov") || (t == "edu") || (t == "mil") || (t == "int"))
break;
-
- // The .name domain uses <name>.<surname>.name
- // Although the TLD is striclty speaking .name, for our purpose
- // it should be <surname>.name since people should not be able
- // to set cookies for everyone with the same surname.
- // Matches <surname>.name
- if (partList[1].lower() == "name")
- break;
}
QString domain = partList.join(".");
_domains.append("." + domain);
Index: kioslave/http/kcookiejar/kcookiejar.h
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/kcookiejar/kcookiejar.h,v
retrieving revision 1.28.2.2
diff -u -p -r1.28.2.2 kcookiejar.h
--- kioslave/http/kcookiejar/kcookiejar.h 9 Feb 2003 14:09:59 -0000 1.28.2.2
+++ kioslave/http/kcookiejar/kcookiejar.h 27 Jul 2004 15:19:49 -0000
@@ -300,8 +300,8 @@ public:
/**
* Returns a list of domains (_domainList) relevant for this host.
*/
- static void extractDomains(const QString &_fqdn,
- QStringList &_domainList);
+ void extractDomains(const QString &_fqdn,
+ QStringList &_domainList);