2

除非我允许接受所有 cookie,否则我无法登录一个银行网站。我使用的是 Firefox 3.0,并且我已将其设置为不接受除已定义列表(工具 - 选项 - 隐私 - Cookies - 例外)之外的 cookie。我已将 Live HTTP Headers 捕获的所有站点添加到白名单中,但登录仍然被禁用。我尝试启用所有 cookie 并登录,然后查看我得到的 cookie - 没有看到任何要添加到例外列表的新站点。显然,该网站以某种方式检查我是否接受任意 cookie。如何找出需要列入白名单的网站?还是我不了解 cookie,并且接受所有 cookie 与将所有正确的网站列入白名单不同?

该网站是https://www.citizensbank.ca/,只有在允许任何 cookie 时才会显示登录字段,否则会显示消息“要登录网上银行,您必须启用 JavaScript 和 cookie”。

4

3 回答 3

3

我会给自己买另一台机器(或 VMWare 映像),删除所有 cookie,允许来自所有站点的所有 cookie,然后转到您的站点并登录(这听起来与您已经尝试过的相似)。

然后,在您的银行会话完成后(或者在此期间,如果他们创建一个短暂的 cookie 只是为了测试您启用了它们),请查看您的 cookie jar 以查看银行添加的内容。这应该告诉您需要添加到真实机器的域。

如果这不起作用,请联系银行并解释您的问题。他们要么告诉你哪些需要允许,要么他们会告诉你全部允许。如果是后者,您需要确定它们是否仍然值得作为您的银行保留。

或者,您可以:

  • 如果您不希望所有 cookie 都出现在主框中,请使用您设置的虚拟机作为访问银行的沙盒。
  • 设置脚本以在 FF 关闭后删除所有未列入白名单的 cookie。
  • 完全停止担心 cookie 并允许它们(我认为我从未听说过 cookie 被用作攻击媒介)。

如果您愿意,请将您的帐户详细信息(用户/密码)发送给我,我会看看是否可以从这里调试它:-) 开个玩笑(以防它不是立即显而易见的)。

更新:

您的银行检查要求的方式特别邪恶。他们会检查您是否接受所有 cookie,这与他们根本没有业务往来。他们应该看看他们是否可以创建一个 cookie 并将其读回,这将使它们与 cookie 管理器兼容。

他们拥有的代码是:

function testCookie() {
    if (typeof navigator.cookieEnabled !== "undefined") {
        return !!navigator.cookieEnabled;
    } else{
        document.cookie="testcookie";
        return document.cookie.indexOf("testcookie")!=-1;
    }
}
if(!testCookie()){
    var browserWarningString = '';
    browserWarningString += '<div class="warning">';
    browserWarningString += '<p>To login to online banking, you must have
        JavaScript and cookies enabled.</p>';
    browserWarningString += '</div>\n';
    document.getElementById("loginAuth").innerHTML = browserWarningString;
}

这是 的第一个位testCookie()return !!navigator.cookieEnabled有问题的位。没有多少白名单 URL 可以在这里为您提供帮助,因为只有在 global 设置为 true 时才会检查cookieEnabled它(这不适合您,这是正确的)。

理想情况下,您只需能够testCookie()在出现的 HTML 中替换该函数。

我发现了一个类似的网站,该网站讨论了来自不同银行的相同问题(我猜银行是所有脑残的 Javascript 小子最终的归宿 :-) 以及两个建议的解决方案。

首先是安装 GreaseMonkey 并在此处使用此脚本。显然,这需要为您的银行进行更改(URL、函数名称等)。

上面第一个链接上的最后一篇文章(目前,查找“afternoonnap,2009 年 2 月 15 日,上午 10:10”的帖子)也展示了如何使用 NoScript 实现相同的结果。这涉及用更合理的脚本替换 cookieEnabled 脚本(针对该特定页面),尽管我可能只是选择替换它"return true"并挂起结果:-)。

希望能有所帮助。

为了完整起见(以防链接消失),我将在此处包含两个脚本。GreaseMonkey 归结为:

// ==UserScript==
// @name          TD Canada Trust EasyWeb Repair
// @namespace     tag:GossamerGremlin,2007-04-28:Repair
// @description   Repair TD Canada Trust EasyWeb website.
// @include       https://easyweb*.tdcanadatrust.com/*
// @exclude       
// ==/UserScript==

var scriptName = "TD Canada Trust EasyWeb Repair";

// The above @include pattern is overbroad because it exposes this
// user script to potential attacks from URLs such as this:
//   https://easyweb.evil.example.com/not.tdcanadatrust.com/bad.html
// The following check eliminates such possibilities:
if (location.href.match(/^https:\/\/easyweb\d\d[a-z].tdcanadatrust.com\//))
{
    // Visibly mark page to remind that this script is in use.
    if (document.body)
    {
        host = document.location.host;
        dummyDiv = document.createElement('div');
        dummyDiv.innerHTML = '<div><span style="color: red">Greased by: ' +
                             scriptName + ' (' + host + ')</span></div>';
        document.body.insertBefore(dummyDiv.firstChild,
            document.body.firstChild);
    }
    unsafeWindow.navigator.__defineGetter__("cookieEnabled",
        canStoreCookieFixed);
}

 

// canStoreCookieFixed()
//   TD's version relies on navigator.cookieEnabled, which is not set
//   if customer has cookie manager, even when cookies are allowed for
//   EasyWeb. The only reliable check for enabled cookies is to actually
//   test if session cookie settings succeed, as done in this function
//   replacement.
function canStoreCookieFixed()
{
    var testSessionCookie ="testSessionCookie=Enabled";
    document.cookie = testSessionCookie;
    return (document.cookie.indexOf(testSessionCookie) != -1);
}

NoScript 版本归结为“将以下内容添加到 about:config”:

noscript.surrogate.nce.sources=@easyweb*.tdcanadatrust.com

noscript.surrogate.nce.replacement=navigator.__defineGetter__(
    "cookieEnabled",function(){
        var ed=new Date;
        ed.setTime(0);
        var tc="__noscriptTestCookie_"+Math.round((Math.random()*99999))
            .toString(16)+"=1";
        document.cookie=tc;
        var ok=document.cookie.indexOf(tc)>-1;
        document.cookie=tc+";expires="+ed.toGMTString();
        return ok
    }
);

测试和更新:

当我在 FF3 中安装 noscript 并完全关闭 cookie 时,然后添加以下about:config项目,登录提示会显示您的银行,所以我认为这可能是要走的路:

noscript.surrogate.nce.sources     = *.citizensbank.ca
noscript.surrogate.nce.replacement =
    navigator.__defineGetter__("cookieEnabled",function(){return true});

我建议您这样做并对其进行测试以确保您仍然拥有所有功能。

于 2009-06-03T01:11:03.170 回答
0

您应该添加他们的注册基域,这样 www.citizensbank.ca 应该可以工作。您也可以尝试在登录时只允许 cookie,并在完成后点击 ctl+shift+del。

于 2009-06-03T00:20:23.193 回答
0

另一种选择 - 使用不同的浏览器来启动该过程。例如,如果您通常使用 Firefox,请尝试使用 Safari、Opera、Chrome 或 MSIE。不要从您的普通浏览器导入任何 cookie。然后检查如何使网站正常工作。

于 2009-06-03T01:44:41.870 回答