Reading and writing values out of the session object is pretty straightforward. But what if you want to store an entire object in there? A common example would be to store user information when logged in.
One way to pull out just one property would be to assign the user object back into a variable and grab the fields from there.
$userinfo = $this->Session->read('User'); echo $userinfo['id'];
I figured there'd be an easier way but the documentation didn't reveal anything so I tried using the forward slash just like you would in the model.
read('User/id') didn't work. I snooped around the code and noticed it uses the period as a separator. Therefore, instead of the above example, you could do the following: