-static QString stripDomain( KHttpCookiePtr cookiePtr)
+QString KCookieJar::stripDomain( KHttpCookiePtr cookiePtr)
{
QString domain; // We file the cookie under this domain.
if (cookiePtr->domain().isEmpty())
@@ -620,6 +628,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)
@@ -634,14 +649,6 @@ void KCookieJar::extractDomains(const QS
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.count() == 2)&& (partList[1].lower() == L1("name")))
- break;
-
QString domain = partList.join(L1("."));
_domains.append('.' + domain);
_domains.append(domain);
Index: kioslave/http/kcookiejar/kcookiejar.h
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/kcookiejar/kcookiejar.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -p -r1.33 -r1.34
--- kioslave/http/kcookiejar/kcookiejar.h 22 Nov 2003 16:50:45 -0000 1.33
+++ kioslave/http/kcookiejar/kcookiejar.h 20 Jul 2004 15:29:24 -0000 1.34
@@ -306,8 +306,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);