"记住"在ASP.Net [英] "Remember Me" in ASP.Net

查看:143
本文介绍了"记住"在ASP.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的C#编程。

我有一个登录控件拖动到我的网站。但是,记住我似乎没有工作,如果我没加任何codeS里

I had drag a login control into my website. But the "Remember me" seem not to be working if i didn't add any codes in.

任何人都可以教我如何贯彻落实记住我在C#中?

Anyone can teach me how to implement the "remember me" in c#?

我想这是当用户再次访问该网站时,他/她输入到用户名文本框,密码就会从数据库和显示屏上的密码文本框,并在同一时间了rememberMe选中复选框将检查被检索。

I want it to be when the user revisit the website, he/she type onto the username textbox, the password will be retrieved from the database and display on the password textbox and at the same time the rememberme checked box will be check.

我一直在研究这个为code代表是天,但没有收获。

I had been researching this for the code for was for days, but was not fruitful.

任何人都可以给我这个教程?

Anyone can give me a tutorial on this?

拼命想知道它是如何工作。

Desperately wanting to know how it works.

希望尽快得到答复。

感谢。

推荐答案

任何人都可以教我如何贯彻落实记住我在C#?

"Anyone can teach me how to implement the "remember me" in c#?"


  1. 如果您希望控件显示下次记住我复选框,则DisplayRememberMe属性设置为true。如果用户选择下次记住我复选框,当他或她登录,认证令牌将被存储在浏览器中的持久性cookie。

  1. If you want the control to display a Remember me next time check box, set the DisplayRememberMe property to true. If a user selects the Remember me next time check box when he or she logs in, the authentication token will be stored in a persistent cookie in the browser.

如果您希望下次记住我复选框被默认选中,设置RememberMeSet属性设置为true。

If you want the Remember me next time check box to be selected by default, set the RememberMeSet property to true.

如果您想验证令牌存储在一个永久性的Cookie没有给用户以清除下次记住我复选框选项,设置RememberMeSet属性设置为true和DisplayRememberMe属性设置为false。这是不建议,可以从为多个用户服务的公共电脑来访问网站,为用户的持久身份验证令牌可以通过不需要的用户使用。

If you want the authentication token to be stored in a persistent cookie without giving the user the option to clear the Remember me next time check box, set the RememberMeSet property to true and set the DisplayRememberMe property to false. This is not recommended for sites that can be accessed from public computers that serve multiple users, as a user's persistent authentication token could be used by an unwanted user.

我想这是当用户再次访问该网站时,他/她输入到用户名文本框,密码就会从数据库和显示屏上的密码文本框,并在同一时间了rememberMe选中复选框将被检索检查

"I want it to be when the user revisit the website, he/she type onto the username textbox, the password will be retrieved from the database and display on the password textbox and at the same time the rememberme checked box will be check."

这不是如何记住我复选框的作品。所有的复选框,并为存储一个身份验证票证在浏览器的cookie。当用户再次访问该网站,没有任何提示登录的身份验证票已经存在,所以用户在自动登录。

That's not how the "Remember Me" checkbox works. All the checkbox does is store an authentication ticket in a cookie in the browser. When the user revisits the site, there is no prompt for login as the authentication ticket already exists, so the user is automatically logged in.

这是可以想象的,你可以修改登录ASCX有一些JavaScript做你想要什么,但在良好的良心,我不能建议你这样做,因为这会使你的网站不安全令人难以置信。

It's conceivable that you could modify the login ASCX with some JavaScript to do exactly what you want, but in good conscience I cannot recommend you do that as it would render your site incredibly insecure.

这篇关于"记住"在ASP.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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