Just try
h.Value = dt.ToString();
.
A cookie only takes text as the value.
As mentioned
here[
^] -
"Cookies can store values only of type String. You must convert any non-string values to strings before you can store them in a cookie. For many data types, calling the ToString method is sufficient. For more information, see the ToString method for the data type you wish to persist.