The state must be an associative array. This class will add additional keys to this
array. These keys will always start with 'SimpleSAML_Auth_State.'.
It is also possible to add a restart URL to the state. If state information is lost, for
example because it timed out, or the user loaded a bookmarked page, the loadState function
will redirect to this URL. To use this, set $state[SimpleSAML_Auth_State::RESTART] to this
URL.
Both the saveState and the loadState function takes in a $stage parameter. This parameter is
a security feature, and is used to prevent the user from taking a state saved one place and
using it as input a different place.
The $stage parameter must be a unique string. To maintain uniqueness, it must be on the form
"." or ":".
There is also support for passing exceptions through the state.
By defining an exception handler when creating the state array, users of the state
array can call throwException with the state and the exception. This exception will
be passed to the handler defined by the EXCEPTION_HANDLER_URL or EXCEPTION_HANDLER_FUNC
elements of the state array.