See: http://www.symfony-project.org/jobeet/1_4/Doctrine/en/13
Subchapter "User Attributes" contains a note addressing the issue
about storing objects directly:
<quote>
We could have feasibly stored the JobeetJob objects directly into the
session. This is strongly discouraged because the session variables
are serialized between requests. And when the session is loaded, the
JobeetJob objects are de-serialized and can be "stalled" if they have
been modified or deleted in the meantime.
</quote>
This of course primarily applies to persistent objects. With non-
persistent objects, or persistent objects that haven't been saved so
far (e.g. false === $object->exists() ) things could look different.

To come back to your question:
- it should work in principle, although it's not necessarily the
cleanest solution
- use a default value $book= $this->getUser()->getAttribute('bk',
null);
- maybe there is a problem with the session --> did you check wether
setAttribute/getAttribute works by trying storing/retrieving any
trivial thing, e.g. a string value?

Hope that helps a bit further...

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to