I am trying to read a cookie with a subkeys to display a message. The cookie name is userID and the subkeys are called firstName and lastName Here is the error message that I get.
Object reference not set to an instance of an object.
Here is the code that I currently have.
Dim fname As String
Dim lname As String
fname = Server.HtmlEncode(Request.Cookies("userInfo")("firstName"))
lname = Server.HtmlEncode(Request.Cookies("userInfo")("lastName"))
Label2.Text = "Welcome back " & fname & " " & lname
Object reference not set to an instance of an object.
Here is the code that I currently have.
Dim fname As String
Dim lname As String
fname = Server.HtmlEncode(Request.Cookies("userInfo")("firstName"))
lname = Server.HtmlEncode(Request.Cookies("userInfo")("lastName"))
Label2.Text = "Welcome back " & fname & " " & lname