====== setUserState ======
{#JAPI Joomla.Framework Application JApplication::setUserState #}
Sets the value of a user state variable. User state variables are stored with the session and are persistent between requests.
===== Syntax =====
mixed setUserState ( **$key**, **$value** )
| **$key** | string | is a string containing the path of the state variable to set. |
| **$value** | string | is a string containing the value of the variable to store. |
===== Examples =====
If the following code is executed on a page load:
global $mainframe;
$mainframe->setUserState( "$option.sampleState", "Stored value" );
then the following code:
global $mainframe;
echo $mainframe->getUserState( "$option.sampleState" );
would produce
Stored value
----
~~DISCUSSION~~