unable to write the persistent cookies

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
 
G

Guest

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
 
K

kuok benny

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 ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top