使用c#在asp.net中进行会话 [英] sessions in asp.net using c#

查看:74
本文介绍了使用c#在asp.net中进行会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生:



我是新的asp.net。我正在使用会话登录页面。我使用的会话实际上是存储消息但是这里的问题是会话没有删除后按logout按钮我使用session.Abandon但问题仍然存在.plz帮助我

谢谢你。

解决方案

尝试 Session [Your_Session_Name] = null 并让我知道它是否有效。



问候..


您好,实际上是Session.Abandon( )删除所有现有会话,如果它突然表现,那么你必须检查你的代码中是否有不同的命名会话或拼写错误。


你可以使用

Session.Remove(varName);或者

Session.RemoveAll();或者

Session.Abandon();

..一旦用户退出...

sir:

i m new asp.net. i am using sessions for login page.the sessions that i used is actually storing
the message but the problem here is sessions are not removing after press logout button i used session.Abandon but the problem is still existing.plz help me
thank you ali.

解决方案

Try Session["Your_Session_Name"]=null and let me know if it works.

Regards..


Hello ,actually Session.Abandon() removes all the existing session ,if it is behaving abruptly then you must check out whether you have different named session or typo mistakes in your code.


You can use
Session.Remove("varName"); or
Session.RemoveAll();or
Session.Abandon();
..as soon as the user logs out...


这篇关于使用c#在asp.net中进行会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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