I have gone through many threads to try and correct my code but it seems the same as the solutions suggested. I am getting no errors and have stepped through the code. Each line seems to be executed but ultimately the cookie is not created. Here is the code:
Dim Cookie As HttpCookie
If Request.Cookies("StoreUserID") Is Nothing
Cookie = New HttpCookie("StoreUserID")
Cookie.Values.Add("UserID",cstr(intUsrID))
Cookie.Values.Add("UserLgn",LoginID.Text)
Cookie.Values.Add("UserPswd",UserPwd.Text)
'Response.Cookies.Add(Cookie)
Response.AppendCookie(Cookie)
end if
Dim Cookie As HttpCookie
If Request.Cookies("StoreUserID") Is Nothing
Cookie = New HttpCookie("StoreUserID")
Cookie.Values.Add("UserID",cstr(intUsrID))
Cookie.Values.Add("UserLgn",LoginID.Text)
Cookie.Values.Add("UserPswd",UserPwd.Text)
'Response.Cookies.Add(Cookie)
Response.AppendCookie(Cookie)
end if