最直接的原因就是第一句 HttpCookie cookie = new HttpCookie("Login"); 失败了 没有成功创建 cookie 实例。所以下面的 cookie 都是 null。 至于为什么失败了,你可以调试看看。