Page 1 of 1

Serverside migration from old cookie handler to new?

Posted: Fri May 23, 2008 4:07 am
by JAB Creations
Currently my website's version is 2.8 Preview IV and for the debut of Preview V I need to get my site's cookie situation in order. I have already setup a new way to handle Preview IV's multiple cookies by imploding/exploding them in/out of a single cookie, the current cookies are listed below.

The issue that is on my mind is migrating visitors who visit after I update my site from Preview IV to Preview V as they will have numerous cookies from Preview IV that aren't compatible with the new backend (that will utilize a cookie called 'settings'). I could just leave the cookies alone and let them expire (one month expiration) but I want to learn how to migrate old cookies efficiently for the sake of knowing how to deal with migration not if but when I'll encounter such scenarios in a business environment.

I was thinking perhaps of using a foreach loop to detect if any of the cookies existed and if so to then execute the function to delete the cookie (setting an expiration date to something like 1/1/1970) while porting each cookie's values to be migrated to the new merged cookie.

Well that is my current thought though I'm open to suggestions and to anyone who wants to share how they migrated visitors from old versions of their backend to new versions. :mrgreen:

For fun here is Preview IV's cookie list...

Code: Select all

$_COOKIE['audio']
$_COOKIE['backgroundimages']
$_COOKIE['browserpatch']
$_COOKIE['chatroom']
$_COOKIE['connection']
$_COOKIE['css3']
$_COOKIE['cursors']
$_COOKIE['dhtmleffects']
$_COOKIE['dtd']
$_COOKIE['ieccss']
$_COOKIE['keyboardlayout']
$_COOKIE['mediatype']
$_COOKIE['personality']
$_COOKIE['powerkeys']
$_COOKIE['sounds']
$_COOKIE['theme']