C
CDARS
Hi all,
I have a confusing question on ASP.NET cookies usage:
1> Response.Cookies("test").value = Now
2> Response.Write(Request.Cookies("test").value)
3>
4> Response.write("<hr>")
5>
6> Response.Cookies("test").value = Now.AddDays(10)
7> Response.Write(Request.Cookies("test").value)
I EXPECT two DIFFERENT dates is printed. The 1st one is today and the
second is 10 days later.
But IN FACT, ASP.NET give me two IDENTICAL dates. From debug mode I
see that AFTER line 6, Request.Cookies("test").value still returns the
old value. Thus line 7 prints the same date as line 2. However when I
look into the cookies file after page load, the cookie is actually
holding the "10-day-later" value.
A very similar ASP 3.0 code gives exactly what I expect (on the same
server, same vitrual root, same IE). I am not even using code-behind
for ASP.NET.
Anyone knows WHY?
and HOW I can fix this?
Many Many Thx!
I have a confusing question on ASP.NET cookies usage:
1> Response.Cookies("test").value = Now
2> Response.Write(Request.Cookies("test").value)
3>
4> Response.write("<hr>")
5>
6> Response.Cookies("test").value = Now.AddDays(10)
7> Response.Write(Request.Cookies("test").value)
I EXPECT two DIFFERENT dates is printed. The 1st one is today and the
second is 10 days later.
But IN FACT, ASP.NET give me two IDENTICAL dates. From debug mode I
see that AFTER line 6, Request.Cookies("test").value still returns the
old value. Thus line 7 prints the same date as line 2. However when I
look into the cookies file after page load, the cookie is actually
holding the "10-day-later" value.
A very similar ASP 3.0 code gives exactly what I expect (on the same
server, same vitrual root, same IE). I am not even using code-behind
for ASP.NET.
Anyone knows WHY?
and HOW I can fix this?
Many Many Thx!