我一直在使用session.clear(),我在Firecookie中注意到会话仍然存在。所以我开始到处搜索,发现有4种方法可以删除会话
Session.Remove(strSessionName); Remove an Item from Session State Collection
Session.RemoveAll() Remove all items from session collection
Session.Clear() Remove all items from session collection Note: There is no difference between Clear and RemoveAll. RemoveAll() calls Clear(), internally.
Session.Abandon() Cancels the Current Session
现在clear和remove似乎做了同样的事情,但是应该使用哪一个,比如为什么使用remove()over-discarge over clear。
就像你使用会话一样。放弃它会杀死当前会话。where clear()删除值。
为什么您只想让会话保持在没有值的状态?为什么不把它完全杀死?