F
Frederic Gignac
Hiya all,
My buddy and I got a bug with the expiration date of a cookie. When we
want to look out the expiration date, the only thing we've got, it's
01/01/0001.
As we know, when we want to create a persitant cookie, we have to put
a expiration date, otherwise, it will be a session cookie. So here our
code :
HttpCookie cookie = new HttpCookie(m_propertyID);
cookie.Value = m_property;
if (m_temporaryCookie == false)
{
cookie.Expires = DateTime.MaxValue;
}
HttpContext.Current.Response.Cookies.Add(cookie);
And when we want to see the value :
HttpCookie cookie =
HttpContext.Current.Request.Cookies[m_propertyID];
if ( cookie != null)
{
HttpContext.Current.Response.Write(cookie.Expires);
}
With that, we've always got the 01/01/0001. If you have any ideas to
help us, let us know.
Btw, sorry for the english typos
My buddy and I got a bug with the expiration date of a cookie. When we
want to look out the expiration date, the only thing we've got, it's
01/01/0001.
As we know, when we want to create a persitant cookie, we have to put
a expiration date, otherwise, it will be a session cookie. So here our
code :
HttpCookie cookie = new HttpCookie(m_propertyID);
cookie.Value = m_property;
if (m_temporaryCookie == false)
{
cookie.Expires = DateTime.MaxValue;
}
HttpContext.Current.Response.Cookies.Add(cookie);
And when we want to see the value :
HttpCookie cookie =
HttpContext.Current.Request.Cookies[m_propertyID];
if ( cookie != null)
{
HttpContext.Current.Response.Write(cookie.Expires);
}
With that, we've always got the 01/01/0001. If you have any ideas to
help us, let us know.
Btw, sorry for the english typos