dlf1987 Posted December 16, 2009 Share Posted December 16, 2009 I'm releasing an updated shopping cart on my website and customers with older cart cookies will have some problems. Their cookies are set to expire 30 days after the cookie is created. So how can i force the cookies to expire that were created, lets say yesterday, without making the new customers cart cookies expire. I'm sure its simple, just cant figure it out :'( Quote Link to comment https://forums.phpfreaks.com/topic/185393-how-to-force-early-expiration-on-cookies/ Share on other sites More sharing options...
Daniel0 Posted December 16, 2009 Share Posted December 16, 2009 Can't you just lower the expiration time to one day only? Quote Link to comment https://forums.phpfreaks.com/topic/185393-how-to-force-early-expiration-on-cookies/#findComment-978814 Share on other sites More sharing options...
dlf1987 Posted December 17, 2009 Author Share Posted December 17, 2009 but that would also make the new cart cookies only last one day as well. I just want to clear returning visitors cookies. Quote Link to comment https://forums.phpfreaks.com/topic/185393-how-to-force-early-expiration-on-cookies/#findComment-979413 Share on other sites More sharing options...
PFMaBiSmAd Posted December 17, 2009 Share Posted December 17, 2009 Once you have set a cookie, it is out of your hands. The only thing you can do the next time someone visits your site is to either detect the older style information and ignore it or overwrite the older style information with different values/expire time. I would suggest creating a cookie that holds the software version number and if the cookie does not exist or if it does exist but has a version number older than the current version, take appropriate action. Quote Link to comment https://forums.phpfreaks.com/topic/185393-how-to-force-early-expiration-on-cookies/#findComment-979420 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.