Assigning attributes to a single page

Permalink
Basically, I'm trying to assign page attributes to a single page, but it doesn't seem to be working. Here's the code I'm using

$c->setAttribute('myAttribute', 'myAttributeValue');


The later, I use this to try to retrieve the value:

$ak = CollectionAttributeKey::getByHandle('myAttribute');
$myAttribute = $c->getCollectionAttributeValue($ak);


But $myAttribute always comes back blank. This is being done within the view function of the single page's controller.

Any thoughts?

jgarcia