Cookie 在 URL 栏中可见,但在浏览器开发工具的应用程序选项卡中不可见

问题描述

如果您转到 didthanoskill.me 并尝试从 URL 栏中访问 c​​ookie,您可以清楚地看到“1 个 Cookie 正在使用中”。在控制台中的 // Manually create a new DataTable DataTable dtEmployees = new DataTable("Employee"); // Add columns dtEmployees.Columns.Add("ID",typeof(int)); dtEmployees.Columns.Add("Name",typeof(string)); dtEmployees.Columns.Add("Salary",typeof(int)); // Add rows to the table dtEmployees.Rows.Add(52,"Sally",29000); dtEmployees.Rows.Add(63,"Harry",22000); dtEmployees.Rows.Add(72,"Alain",23000); dtEmployees.Rows.Add(110,"Pete",24500); // Look for an employee... int index = 2; Console.WriteLine("(index of DataRow({0}) should return {0})",index); DataRow employee = dtEmployees.NewRow(); employee["ID"] = dtEmployees.Rows[index]["ID"]; employee["Name"] = dtEmployees.Rows[index]["Name"]; employee["Salary"] = dtEmployees.Rows[index]["Salary"]; int indexFound = dtEmployees.Rows.IndexOf(employee); if (indexFound != -1) Console.Write(" Employee has index {0}",indexFound); // Was expecting this... else Console.Write(" Employee not found in table..."); // ...but actually get this. Why?? 上,返回空字符串。我认为 cookie 必须是 HttpOnly,所以我转到浏览器开发工具中的应用程序选项卡,也没有显示 cookie。奇怪!

知道为什么会这样吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)