Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a site (that is Internet Explorer dependent) that sets two persistent cookies to DateTime.MaxDate (Dec 31, 9999). The two cookies are needed in requests to do mappings of customers to their respective data sources. When requests that need those cookies come in without those cookies, it gets logged. currently it's happening about 2000 times a day and I can't figure out why.

What's odd is that the cookie is there for some uses requests then gets dropped. It comes back for the same user, presumably they've signed back in and had the cookie re-initialized. I've seen the error occur for one user at a client IP address and all the users at a client IP address.

Any ideas on what would randomly drop a persistent cookie?

Here's the things that have been tested so far:

-Our own code (no where do we reset the expiration to anything other than DateTime.Max)
-Different versions of IE (cookie is dropped in IE7-IE11)
-IE Privacy settings
-Cookie overload (there is always less than 20 cookies, less than 4KB)
-Third party software (turned off all our analytics and other apps that might interfere)
-User security software (a possibility, but I can't find any that deletes cookies)
-Other script over-writing (cookies are set to HTTPOnly)
-Various iterations of different/multiple users/sessions/computers.
Posted
Comments
Richard Deeming 14-May-15 15:05pm    
Try setting a more realistic expiration date - say, 10 years from the current date. It's possible that some browsers can't cope with a date so far in the future, and decide to treat the cookie as a session cookie instead.
KRM 14-May-15 16:40pm    
We are adjusting that down to 1 year, but our app targets only IE, which doesn't seem to have a problem with a DateTime.Max expiration, at least that we've seen in testing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900