Thursday 03 May 2007 8:17:17 am
I'm working on a site where anonymous users can post new objects. However, I need them to be able to browse the site, and come back to editing the object later. In order to do that, I figure I should store the object id in a preferences or session variable. I cannot just fetch the drafts, since there is no way I can discriminate between which draft belongs to which of the anonymous users on the system. So I've made myself a new extension with a new operator doing this:
$db->begin();
eZPreferences::setValue( $namedParameters['name'] ,(string)$namedParameters['value']);
$db->commit();
It almost works, but just almost. Sometimes the variable is set as I want it to. Sometimes it is not set. It works better on some machines and browsers than on other. On some it works almost all of the time. On others just occasionally. I've tried adding
eZPreferences::storeInSession( $namedParameters['name'] ,(string)$namedParameters['value']);
But it makes no difference. Neither does this work with session variables. Using /user/preferences/set/ works very well all of the time. What am I doing wrong? Is there a simpler way of doing what I want to do?
|