Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道 ASP.NET 是否具有类似于session_idPHP 的功能。
session_id
我想使用 ASP.NET 做类似的事情:
session_id($_GET['session_name']); session_start(); if ($_SESSION['mydata'] != 'somepreviousvaluesetted') { header("HTTP/1.0 404 Not Found"); exit; }
那有可能吗?
session 对象有一个 SessionID 属性,但它不给你启动会话的能力;但是,在 global.asax 中,有一个 Session_Start 处理程序,它会在会话开始时触发。会话在用户访问应用程序时开始。
HTH。