how to remember password in login page .
-
In the login control, there is a property for saving the password with a check box.i need the code other than the login control.I use seperate textboxes and check box to create login page.If any one know this pls give the code :)
-
In the login control, there is a property for saving the password with a check box.i need the code other than the login control.I use seperate textboxes and check box to create login page.If any one know this pls give the code :)
U will have to use cookies for it. Save ur Password in Cookies...
-
U will have to use cookies for it. Save ur Password in Cookies...
i use the following code to save cookies is this correct. HttpCookie cookie = new HttpCookie("cookiename"); cookie.Values.Add("UserName", TextBox1.Text); cookie.Values.Add("Password", TextBox2.Text); cookie.Expires = DateTime.Now.AddDays(30);
-
i use the following code to save cookies is this correct. HttpCookie cookie = new HttpCookie("cookiename"); cookie.Values.Add("UserName", TextBox1.Text); cookie.Values.Add("Password", TextBox2.Text); cookie.Expires = DateTime.Now.AddDays(30);
Use this javascript Function: function readCookie(cookies) { var txtuname; var txtpass; var chkRememberLogin; if(document.getElementById('ctl00_CustomLogin_txtUserName') != null) { txtuname = document.getElementById('txtUserName'); txtpass = document.getElementById('txtPassword'); chkRememberLogin = document.getElementById('chkCookie'); } else { txtuname = document.getElementById('txtUserName'); txtpass = document.getElementById('txtPassword'); chkRememberLogin = document.getElementById('chkCookie'); } if (document.cookie.length>0 && txtuname.value.length>0 ) { // check the index of the username that is entered by user in Username text box var c_start=document.cookie.indexOf(txtuname.value); if (c_start!=-1) { var c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) { c_end=document.cookie.length; } var value= unescape(document.cookie.substring(c_start,c_end)); var arr = new Array(10); arr= value.split('='); // if only 0ne equal sign is present that is default one if(arr[0]==txtuname.value && arr.length==2) { txtpass.value=arr[1]; chkRememberLogin.checked = true; } // if the password contain =(equal) signs in it else if(arr[0]==txtuname.value && arr.length > 2) { var pass=arr[1]; for(i=2;i<arr.length;i++)> { pass += arr[i]; } txtpass.value=pass; chkRememberLogin.checked = true; } else { txtpass.value=""; chkRememberLogin.checked = false; } } else { txtpass.value=""; chkRememberLogin.checked = false; } } else { txtpass.value=""; chkRememberLogin.checked = false; } } In Page Load Put this: txtPassword.Attributes.Add("OnFocus", "javascript:readCookie('" & Request.Cookies.ToString() & "');") Above line will get the password in password textbox on focus event. Finally on Login Button Click Event where u have to store password in cookies: If chkRememberMe.Checked Then Dim cookie As New Ht
-
In the login control, there is a property for saving the password with a check box.i need the code other than the login control.I use seperate textboxes and check box to create login page.If any one know this pls give the code :)
I would NEVER save a username/password in a cookie, which a user can read on their PC if they know how. I would store a GUID in a cookie and in your DB, associate that GUID with a login id. This means the client side doesn't have the username/password combo, but you can log them in.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )