コード例 #1
0
ファイル: Channel.php プロジェクト: jkinner/ringside
 public static function createUserCookies(NetworkSigner $signer, $network_key = null)
 {
     if (isset($this->api_key)) {
         $cookies_to_set = array();
         $cookies = array();
         $cookies['user'] = $user;
         $cookies['session_key'] = $session_key;
         $sig = $signer->sign($cookies, $this->secret);
         foreach ($cookies as $name => $val) {
             $cookies_to_set[($network_key !== null ? $network_key : '') . $this->api_key . '_' . $name] = $val;
         }
         $cookies_to_set[($network_key !== null ? $network_key : '') . $this->api_key] = $sig;
     }
 }
コード例 #2
0
ファイル: Context.php プロジェクト: jkinner/ringside
 public static function verifySignature(NetworkSigner $signer, $params, $secret, $signature)
 {
     $signer->sign($params, $secret) == $signature;
 }