Full ELMS Learning Network documentation
function advagg_admin_toggle_bypass_cookie
cis7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
cle7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
elmsmedia7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
icor7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
meedjum_blog7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
mooc7 advagg.admin.inc | advagg_admin_toggle_bypass_cookie() |
Set or remove the AdvAggDisabled cookie.
1 string reference to 'advagg_admin_toggle_bypass_cookie'
- advagg_admin_operations_form in sites/
all/ modules/ ulmus/ advagg/ advagg.admin.inc - Form builder; Do advagg operations.
File
- sites/
all/ modules/ ulmus/ advagg/ advagg.admin.inc, line 505 - Admin page callbacks for the advanced CSS/JS aggregation module.
Code
function advagg_admin_toggle_bypass_cookie() {
$cookie_name = 'AdvAggDisabled';
$key = drupal_hash_base64(drupal_get_private_key());
// If the cookie does exist then remove it.
if (!empty($_COOKIE[$cookie_name]) && $_COOKIE[$cookie_name] == $key) {
setcookie($cookie_name, '', -1, $GLOBALS['base_path'], '.' . $_SERVER['HTTP_HOST']);
unset($_COOKIE[$cookie_name]);
drupal_set_message(t('AdvAgg Bypass Cookie Removed.'));
}
// If the cookie does not exist then set it.
else {
// Cookie will last for 12 hours.
setcookie($cookie_name, $key, REQUEST_TIME + (60 * 60 * 12), $GLOBALS['base_path'], '.' . $_SERVER['HTTP_HOST']);
$_COOKIE[$cookie_name] = $key;
drupal_set_message(t('AdvAgg Bypass Cookie Set.'));
}
}