I have a system for storing data (e.g. accessibility settings like colour contrast) for anonymous and authenticated users. Authenticated users have the data in a dedicated table.
For anonymous users I'm using CTools object cache so if the person keeps the session he won't lose his accessibility settings. (I might use this for storing searches as well.)
I could use Session API but there is a potential issue with European cookie law - yes, this is about site usability which theoretically trumps that law but it's a very public site so the client doesn't want any trouble, valid or not.
Okay, so here's the point: If a person registers I need to go from CTools to my custom storage. The actual process of doing that is simple enough but when a person registers, their session ID changes, so once they are logged in (e.g. when hook_user_register() gets called) the old session ID is dead and gone.
Any ideas how I can keep the old session ID, or transfer the data from not-logged-in to logged-in? (Putting the data in form_state in the user_register_form goes some of the distance, but not all of it.)