/** * Set 'NoMobile' cookie for current user to prevent use of mobile theme. * * @since 2.0.? * @access public */ public function NoMobile() { $Expiration = time() + 172800; $Expire = 0; $UserID = Gdn::Session()->IsValid() ? Gdn::Session()->UserID : 0; $KeyData = $UserID . "-{$Expiration}"; Gdn_CookieIdentity::SetCookie('VanillaNoMobile', $KeyData, array($UserID, $Expiration, 'force'), $Expire); Redirect("/", 302); }
/** * Set 'NoMobile' cookie for current user to prevent use of mobile theme. * * @since 2.0.? * @access public */ public function NoMobile($Unset = 0) { if ($Unset == 1) { // Allow mobile again Gdn_CookieIdentity::DeleteCookie('VanillaNoMobile'); } else { // Set 48-hour "no mobile" cookie $Expiration = time() + 172800; $Expire = 0; $UserID = Gdn::Session()->IsValid() ? Gdn::Session()->UserID : 0; $KeyData = $UserID . "-{$Expiration}"; Gdn_CookieIdentity::SetCookie('VanillaNoMobile', $KeyData, array($UserID, $Expiration, 'force'), $Expire); } Redirect("/", 302); }
protected function _Remember($Key, $SerializedCookiePayload) { Gdn_CookieIdentity::SetCookie($this->_CookieName, $Key, array(1, 0, $SerializedCookiePayload), 0); }