Symfony 1.4: Storing an array in session with SetAttribute

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-16T23:14:50Z Indexed on 2010/04/16 23:23 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

Hi,

I'm wondering if someone knows how to store an array into a user session?

This is the method to store a single attribute:

$this->getUser()->setAttribute('something', $something);

And the documentation says:

"User attributes can store any type of data (strings, arrays, and associative arrays)"

... but doesn't say anything more. The API documentation doesn't have a "SetAttributes" or something similarly obvious.

Thank you.

© Stack Overflow or respective owner

Related posts about symfony

Related posts about symfony-1.4