How are you storing your session in a database right now? Are you using
Zend_Session?
I don't store my sessions in the database (just the default save handler for
Zend_Session), but you can create an array of data, or even an object and
store it to the session.
$authNamespace = new Zend_Session_Namespace('UserAuth');
$user = array('id' => $userId, 'name' => $userName);
$authNamespace->user = $user;
Also, the proposal was probably removed because you can use the session save
handler for dbtable right now:
http://framework.zend.com/manual/en/zend.session.savehandler.dbtable.html
With the DB save handler it should probably serialize your arrays/objects
before saving to database.
Konr
On Thu, Jan 28, 2010 at 5:44 AM, dmitrybelyakov <[email protected]>wrote:
>
> Hi,
>
> I just want to make sure that there’s currently no functionality to allow
> having additional fields in a session database table, like a userId for
> example.
>
> Am I missing something? Or should I achieve this on application level by
> writing my own Session_Save_Handler?
>
> As I look at
>
> http://framework.zend.com/wiki/display/ZFPROP/Zend_Session_SaveHandler_DbTable
> Zend_Session_SaveHandler_DbTable proposal - I can see that this
> functionality was initially planned but seems to be removed.
>
> Am i correct?
>
>
> Thanks a lot,
> Dmitry.
> --
> View this message in context:
> http://n4.nabble.com/Is-saving-userId-in-a-session-database-table-possible-Zend-Session-SaveHandler-DbTable-tp1359860p1359860.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>