最近在写一个博客,发现localhost调试时,Cookie一直为null。 后面找了相关资料发现,很多浏览器都无法使用localhost写入Cookie 在Google Chrome中,使用127.0.0.1,可以正常写入Cookie。