Пример #1
0
 public function read()
 {
     $value = HTTP::cookie($this->_source);
     if (function_exists('json_decode')) {
         $value = json_decode($value);
         $this->contents($value);
         $this->loadArray((array) $value);
     }
     return $value;
 }
Пример #2
0
 static function redirect($href = '', $request_r = '', $ssl = '', $snapshot = '')
 {
     $href = HTTP::href($href);
     $request = $request_r ? http_build_query($request_r) : "";
     $href = str_replace('http://', '', $href);
     $href = str_replace('https://', '', $href);
     $href = ($ssl == true ? 'https' : 'http') . "://{$href}" . ($request != '' ? "?{$request}" : "");
     if ($snapshot != '') {
         HTTP::cookie('href_snapshot', $snapshot);
     }
     header("Location: {$href}");
 }