setLanguageCookie() public static method

This method will attempt to set the user-selected language in a cookie. It will do nothing if the language specified is not in the list of available languages, or the headers have already been sent to the browser.
public static setLanguageCookie ( string $language )
$language string The language set by the user.
Example #1
0
 /**
  * @param $language
  * @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Locale\Language::setLanguageCookie()
  * instead.
  */
 public static function setLanguageCookie($language)
 {
     \SimpleSAML\Locale\Language::setLanguageCookie($language);
 }
    SimpleSAML_Logger::debug('casserver:' . $message);
    throw new Exception($message);
}
$as = new SimpleSAML_Auth_Simple($casconfig->getValue('authsource'));
if (array_key_exists('scope', $_GET) && is_string($_GET['scope'])) {
    $scopes = $casconfig->getValue('scopes', array());
    if (array_key_exists($_GET['scope'], $scopes)) {
        $idpList = $scopes[$_GET['scope']];
    } else {
        $message = 'Scope parameter provided to CAS server is not listed as legal scope: [scope] = ' . var_export($_GET['scope'], true);
        SimpleSAML_Logger::debug('casserver:' . $message);
        throw new Exception($message);
    }
}
if (array_key_exists('language', $_GET) && is_string($_GET['language'])) {
    \SimpleSAML\Locale\Language::setLanguageCookie($_GET['language']);
}
$ticketStoreConfig = $casconfig->getValue('ticketstore', array('class' => 'casserver:FileSystemTicketStore'));
$ticketStoreClass = SimpleSAML_Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket');
$ticketStore = new $ticketStoreClass($casconfig);
$ticketFactoryClass = SimpleSAML_Module::resolveClass('casserver:TicketFactory', 'Cas_Ticket');
$ticketFactory = new $ticketFactoryClass($casconfig);
$session = SimpleSAML_Session::getSessionFromRequest();
$sessionTicket = $ticketStore->getTicket($session->getSessionId());
$sessionRenewId = $sessionTicket ? $sessionTicket['renewId'] : null;
$requestRenewId = isset($_REQUEST['renewId']) ? $_REQUEST['renewId'] : null;
if (!$as->isAuthenticated() || $forceAuthn && $sessionRenewId != $requestRenewId) {
    $query = array();
    if ($sessionRenewId && $forceAuthn) {
        $query['renewId'] = $sessionRenewId;
    }