2010-12-22 34 views

回答

2

这是不可能的.NET低于4

在ASP.NET 4.0中,您可以使用此类似的代码,启用和禁用会话:

HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Default); 

* Default: passing this means that everything works as before (ie, you control session through the @page directive or the <pages> entry in the web.config file); 
* Required: session state is enabled for read/write access; 
* ReadOnly: gives access to read only session state; 
* Disabled: turns off session state for the current request. 
+0

7年后,我不知道如果说有什么改变了吗?它似乎没有......我仍然无法找到任何真正模仿php的`session_write_close`的方法。 – David784 2018-03-07 16:40:53

相关问题