2
我一直在使用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
现已明确,并删除似乎做同样的事情,但哪一个你应该可以使用像这样为什么使用remove()方法上摒弃了明确。
就像你使用session.Abandon它杀死了当前会话。 clear()将删除这些值。
为什么你只想保持会议中没有任何值呢?为什么不把它完全杀死?