在调试 ASP.NET 页面期间是否可以修改值、键甚至清除会话?
我在即时窗口中尝试了以下操作(按呈现的顺序),但没有改变 Session 对象:
Session.Clear()
Expression has been evaluated and has no value
Session.Keys
{System.Collections.Specialized.NameObjectCollectionBase.KeysCollection}
Count: 12
Session.Clear()
Expression has been evaluated and has no value
Session.Keys[0]
"user_id"
Session.Abandon()
Expression has been evaluated and has no value
Session["user_id"]
3
编辑:好的,看起来我有时可以改变它。这是非常令人费解的。如果有人知道为什么有时会失败,我会很感激拥有这些知识。