I have a form that creates a cookie and saves it to the users computer. The user is then redirected to another page.
Depending on options in the cookie cretain objects will be visible.
Here is my code
FORM 1
FORM2
This code will work while the broswer is open. But When I close the browser and open it back up the code executes as if no cookie is present. What am I missing in my code?
I am using VS 2003 with .Net Framework 1.1
Jason Meckley
Database Analyst
WITF
Depending on options in the cookie cretain objects will be visible.
Here is my code
FORM 1
Code:
Dim Cookie As New HttpCookie("AnswerService")
Dim Pwd As String = txtPwd.Text
Cookie.Values.Add("Pwd", Pwd)
Response.Cookies.Add(Cookie)
Response.Redirect("../")
Code:
If Request.Cookies("AnswerService") Is Nothing Then 'no cookie (web pledge)
chkBillMe.Visible = False
rfvBillMe.Visible = False
Else 'cookie = test for answer service
Dim Cookie As HttpCookie = Request.Cookies("AnswerService")
If Cookie.Item("Pwd") = "123" Then 'hide cc and exp date validation
rfvCC_1.Visible = False
rfvExpMonth.Visible = False
rfvExpYear.Visible = False
rfvExpDate.Visible = False
Else 'not answering service
chkBillMe.Visible = False
rfvBillMe.Visible = False
End If
End If
This code will work while the broswer is open. But When I close the browser and open it back up the code executes as if no cookie is present. What am I missing in my code?
I am using VS 2003 with .Net Framework 1.1
Jason Meckley
Database Analyst
WITF