是什么在ASP.Net Session.Abandon()和Session.Clear()之间的区别? [英] What is the difference between Session.Abandon() and Session.Clear() in ASP.Net?

查看:121
本文介绍了是什么在ASP.Net Session.Abandon()和Session.Clear()之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么在ASP.Net Session.Abandon() Session.Clear()之间的区别?

What is the difference between Session.Abandon() and Session.Clear() in ASP.Net?

推荐答案

Session.Abandon()将结束当前会话。 Session_End中将被解雇,下一个请求将触发在session_start 事件。

Session.Abandon() will end the current session. Session_End will be fired and the next request will fire the Session_Start event.

Session.Clear 只会清除会话数据和会话仍然活着。

Session.Clear will just clear the session data and the the session will remain alive.

会话ID将保持不变在这两种情况下,只要该浏览器没有关闭。

Session ID will remain the same in both cases, as long as the browser is not closed.

简而言之:

Session.Abandon(); 取消当前会话

Session.Clear(); 会话状态

这篇关于是什么在ASP.Net Session.Abandon()和Session.Clear()之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆