reinoutkool
asked on
check if cookie exists in vb.net
if I try to read a cookie (or session variable) that does not exist anymore I get a server error.
below an example of the code
if Request.Cookies("name of cookie") = "xyz" then
//some code
end if
a check like
- if Request.Cookies("name of cookie") = ""
- if Request.Cookies("name of cookie").length = 0
gives the same problem
is there a simple solution? in classic asp this was not an issue
below an example of the code
if Request.Cookies("name of cookie") = "xyz" then
//some code
end if
a check like
- if Request.Cookies("name of cookie") = ""
- if Request.Cookies("name of cookie").length = 0
gives the same problem
is there a simple solution? in classic asp this was not an issue
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If Not Request.Cookies("UserSetti
If Not Request.Cookies("UserSetti
...
end if
end if