如何在.NET登录后更改sessionid?(How to change sessionid after login in .NET?)

编程入门 行业动态 更新时间:2024-10-14 04:23:16
如何在.NET登录后更改sessionid?(How to change sessionid after login in .NET?)

出于安全原因,我想在登录后更改session_id。 在php中,有一个函数session_regenerate_id(); 这可以改变sessionid而不会丢失当前的会话信息。

.NET中有类似的功能吗?

For security reasons, I want to change session_id after login. In php, there's a function session_regenerate_id(); which can change sessionid without losing current session information.

Is there a similar function in .NET ?

最满意答案

ASP.NET不直接支持重新生成会话ID的功能。 请参阅有关该问题的文档。 通过将ASPNET_SessionID值设置为空字符串并重定向以便重新生成值,有一种不那么快速和脏的方法 。

ASP.NET does not directly support functionality to regenerate a session ID. See the documentation regarding the issue. There is a not-so quick and dirty way to do it by setting the ASPNET_SessionID value to the empty string and redirecting so that the value is regenerated.

更多推荐

本文发布于:2023-08-07 18:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465369.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   NET   sessionid   change   login

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!