R
Raghu Raman
Hi,
I want to store a cookie peemanently for 2 days.From msdn article, i
have coded like this.It is working when i run my application .But if i
close my browser and restart my application , i could not find the
stored cookie,it was gone .
my code
-----------------
dt=DateTime.Now;
ckdate=dt.ToString("dd-MMM-yyyy",DateTimeFormatInfo.InvariantInfo);
sid=Session.SessionID.ToString();
HttpCookie ht=new HttpCookie("usercook",ckdate + "^" + sid);
ht.Expires.AddDays(2);
Response.Cookies.Add(ht);
--------------------------
if(Request.Cookies["usercook"]!=null) then it shows null.
Even i close my app and restart again ,i need the value that i stored
last time in the cookie.Pls tell my ,how to store a permanent cookie.
Regards
Raghu
I want to store a cookie peemanently for 2 days.From msdn article, i
have coded like this.It is working when i run my application .But if i
close my browser and restart my application , i could not find the
stored cookie,it was gone .
my code
-----------------
dt=DateTime.Now;
ckdate=dt.ToString("dd-MMM-yyyy",DateTimeFormatInfo.InvariantInfo);
sid=Session.SessionID.ToString();
HttpCookie ht=new HttpCookie("usercook",ckdate + "^" + sid);
ht.Expires.AddDays(2);
Response.Cookies.Add(ht);
--------------------------
if(Request.Cookies["usercook"]!=null) then it shows null.
Even i close my app and restart again ,i need the value that i stored
last time in the cookie.Pls tell my ,how to store a permanent cookie.
Regards
Raghu