Cookies and Expiration Dates
Posted on 2004-09-27
I am trying to change the cookies that we use on our company website. Currently the cookies that are set are set to expire one year after they are created in the users cookie folder. What I want to do is to change the expiration date to be in 24 hours, which I know how to do. The problem that I am having is how do I force the user to create a new cookie with the new expiration date when the cookie that they have on their system is not set to expire until 1 year. I could have all th users log off the website the next time they leave which deletes out the cookie, but it probably would not catch everyone. Is there some code that I could use to check and see if the expiration date is longer than a cetain amount of time and then create a new one if it is? I also thinking of using session cookies instead of cookies that expire. Any help would be greatly appreciated.