Asp.net_SessionId和Authaspx cookie [英] Asp.net_SessionId and Authaspx cookie

查看:74
本文介绍了Asp.net_SessionId和Authaspx cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个Web应用程序,使用了表单身份验证。

有一个default.aspx页面可以由经过身份验证的用户打开。

退出时默认页面,重定向到Login.aspx页面。

有两种不同的情况 -

1st-如果我再次登录Login.aspx的默认页面,则ASP.Net_SessionId保持不变。

第二种情况 - 如果从默认页面退出后,我关闭浏览器,然后再次登录,然后创建不同的SessionId。



解释差异。

谢谢。

I have made a web application,have used form authentication.
There is a default.aspx page which can be open by authenticated users.
on logging out from default page, redirected to Login.aspx page.
There are two different cases-
1st- if i again login to default page from Login.aspx ,then ASP.Net_SessionId remains same.
2nd case-if after logging out from default page,i close browser,and login again then different SessionId is created.

explain the difference.
thanks.

推荐答案

http://msdn.microsoft.com/en-us/library/ff647070.aspx [ ^ ]



http://stackoverflow.com/questions/3451 57 / asp-net-how-to-clear-out-session-on-log-out [ ^ ]


注销时使用

While Logout use
Session.Removeall()
Session.Abandon()



以上代码将清除会话但不会清除ASP .Net_SessionID。清除这一用法以下代码


The above code will clear the sessions but it wont clear ASP.Net_SessionID. to clear this one use below code

Response.cookies("ASP.Net_SessionId ").value = string.empty



问候,

Norbert


Regards,
Norbert


这篇关于Asp.net_SessionId和Authaspx cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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