Talk:How to use user state variables
From Joomla! Documentation
I found that this didn't work:
$mainframe->setUserState( "$option.state_variable", "state1" );
Instead, the dollarsign should not be used, since it creates a fatal error. It should be changed to:
$mainframe->setUserState( "option.state_variable", "state1" );