Is it possible to modify values, keys or even clear the Session during debugging of an ASP.NET page?
I tried the following in the Immediate Window (in the presented order), but nothing changed the Session object:
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
Edit: OK, it looks like I can sometimes change it. This is very puzzling. If someone knows why it's sometimes failing, I'd appreciate having that knowledge.