且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何沿着持久性cookie进行会话以进行表单身份验证?

更新时间:2023-12-06 07:59:34

很难理解您的问题是什么,但是我仍然可以发表一些评论.

It is difficult to understand what your question is, but I can make a few comments anyway.

使用FormsAuthentication.SetAuthCookie代替Response.Cookies.Add.

Use FormsAuthentication.SetAuthCookie instead of Response.Cookies.Add.

避免在会话中存储凭据.也许您可以解释为什么您发现它是必要的.

Avoid storing credentials in the session. Maybe you can explain why you found that it was necessary.

ASP.NET支持无cookie身份验证,而无需在会话中手动存储凭据.您会看到FormsAuthentication.SetAuthCookie支持用于无cookie身份验证的URL参数.

ASP.NET supports cookieless authentication without the need to manually store credentials in the session. You will see that the FormsAuthentication.SetAuthCookie supports a URL parameter for cookieless authentication.

我希望能有所帮助.如果没有,您能否解释您要达到的目标.

I hope that helps. If it does not, can you explain what you are trying to achieve.