Hello,
I'm working on Remember me Check box on login i'm creating cookies. These cookies are properly save on cookies when logout then its assign username to user name text box not for password. Why Password is not assigned? and second when i closed the page and then open this page nothing in cookie and not display any data on text boxes.
What should I do? Please help me
Thanks in advance.....................
ArshadPosted May 6, 2008, 4:50 PM
Hi,just try some thing like that.
If (checkBox1.Checked) Then
Response.Cookies("LoginID").Value = Trim$(txtUserID.Text)
Response.Cookies("LoginID").Expires = Date.Today.AddDays(1)
Response.Cookies("Password").Value = Trim$(txtpassword.Text)
Response.Cookies("Password").Expires = Date.Today.AddDays(1)
End If
After that go to the Page Load And Add this
If Not IsNothing(Request.Cookies("LoginID")) Then
txtUserID.Text = (Request.Cookies("LoginID").Value & "")
End If
If Not IsNothing(Request.Cookies("Password")) Then
txtpassword.Text = (Request.Cookies("Password").Value & "")
End If
Thanks
Regards
Arshad Khan
HinaPosted Apr 6, 2008, 3:45 PM
in my privious post i've sent you the code but not solution for this. please help me!
On Loginbutton_ Click
If chk_Remember.Checked ThenResponse.Cookies(
"User_ID").Value = txt_UserID.TextResponse.Cookies(
"Password").Value = txt_Password.TextEnd If
Page load Event
If Request.Browser.Cookies Then If Not Request.Cookies("User_ID") Is Nothing Thentxt_UserID.Text = Server.HtmlEncode(Request.Cookies(
"User_ID").Value) End If If Not Request.Cookies("Password") Is Nothing Thentxt_Password.Text = Server.HtmlEncode(Request.Cookies(
"Password").Value) End If End Ifbut not cookies maintain im my system when open this website. How i can maintain my cookies and login automatically by cookies username and password.
Thanks
Bechir BejaouiPosted Apr 6, 2008, 3:35 PM