Techhead - - I'm running this on version 4.0.9 -= the error you're getting seems to be with altering the session - around this line in my code:
// now update the session
Have you checked that .12 still stores sessions in this same table and fields?
Can you paste the rest of the error so I can take a look at it?
X-Cart Versions 3.5.x - 4.0.x