J
Johnnie Norsworthy
I have a cookie that I create when a user clicks a button on my web page:
HttpCookie Sig = new HttpCookie("Signature");
Sig.Value = Signature.Text; // a memo box
TimeSpan NinetyDays = new TimeSpan(90,0,0,0,0);
Sig.Expires = DateTime.Now+NinetyDays;
Response.Cookies.Add(Sig);
Tracing through this code shows no errors. But I must be missing something
else having to do with saving the cookie, because in my Page_Load I do this:
if (IsPostBack) return;
// get any signature that might exist
try
{
Signature.Text = Request.Cookies["Signature"].Value;
}
catch
{
Signature.Text = ""; //<< - always comes here with "Object reference not
set to an instance of an object"
}
This is such a simple routine, I hope someone can tell me what I am doing
wrong, or not doing.
Thanks for any help.
-Johnnie
HttpCookie Sig = new HttpCookie("Signature");
Sig.Value = Signature.Text; // a memo box
TimeSpan NinetyDays = new TimeSpan(90,0,0,0,0);
Sig.Expires = DateTime.Now+NinetyDays;
Response.Cookies.Add(Sig);
Tracing through this code shows no errors. But I must be missing something
else having to do with saving the cookie, because in my Page_Load I do this:
if (IsPostBack) return;
// get any signature that might exist
try
{
Signature.Text = Request.Cookies["Signature"].Value;
}
catch
{
Signature.Text = ""; //<< - always comes here with "Object reference not
set to an instance of an object"
}
This is such a simple routine, I hope someone can tell me what I am doing
wrong, or not doing.
Thanks for any help.
-Johnnie