unable to write the persistent cookies

  • Thread starter Thread starter benny
  • Start date Start date
B

benny

Hi,

I tried the following method to add persistent cookies :-

HttpCookieCollection MyCookieCollection = new HttpCookieCollection();
HttpCookie MyCookie = new HttpCookie("LastVisit");
MyCookie.Value = DateTime.Now.ToString();
MyCookieCollection.Add(MyCookie);

I found out the above code seem not working if my setting on IE6.0 on
Tools->Internet Option->Privacy is setting to medium and I din check the
Advance ->override automatic cookies handling.
It works only while I check the option on override automatic cookies
handling, where I could see the physical cookies on the Temporary Internet
Files. Anyone know how to solve this problem?
Thanks in advance.

regards,
benny
 
Hi Benny,

Pls set the expiration period for the cookies in order to make it persistent

MyCookie.Expires = Now() + 5
If you do not set the Expires attribute like the example below sets it, the
cookie will expire when the user closes their browser.

I hope it helps you

regards
Nishith
 
hi,

I do try:-
MyCookie.Expires = Now() + 5
but it doesn't work if my setting on IE6.0 on
Tools->Internet Option->Privacy is setting to medium and I din check the
Advance ->override automatic cookies handling.
It works only while I check the option on override automatic cookies
handling, where I could see the physical cookies on the Temporary
Internet Files. how to solve this problem?
Thanks in advance.

regards,
benny ;)
 
Back
Top