Esempio n. 1
0
 public function storeAndGet($key)
 {
     $postKey = $key . '_' . $this->_postSuffix;
     $cookieKey = $this->_cookiePrefix . '_' . $key;
     if (isset($_POST[$postKey])) {
         My_cookie_helper::setCookie($cookieKey, $_POST[$postKey]);
         $this->_filters[$key] = $_POST[$postKey];
         return $_POST[$postKey];
     } else {
         $cookieVal = My_cookie_helper::getCookie($cookieKey);
         Debug::log('fetching from cookie ' . $cookieKey . ', fetched: ' . $cookieVal);
         return $cookieVal;
     }
 }
Esempio n. 2
0
 public static function deleteCookie($name)
 {
     Debug::log("Removing cookie - {$name}");
     My_cookie_helper::setCookie($name, '');
 }