To allow Varnish to remove the has_js cookie for logged-in users, therefore allowing stuff like ctools and batchapi to work, we just wrote the following into a 'tweaks' module. This puts the has_js javascript into the header, but then removes any has_js cookies on logout.
<code>
/**
* Add the has_js cookie to the user's JS entry
*/
function site_tweaks_init() {
global $user;
if($user->uid > 0) {
drupal_add_js('document.cookie = "has_js=1; path=/";', 'inline');
}
}
/**
* Adds a 'has_js' cookie for only logged-in users
*/
function site_tweaks_user($op, &$edit, $account) {
if($op == 'logout') {
setcookie('has_js', '', time() - 3600);
}
}
</code>
To allow Varnish to remove the has_js cookie for logged-in users, therefore allowing stuff like ctools and batchapi to work, we just wrote the following into a 'tweaks' module. This puts the has_js javascript into the header, but then removes any has_js cookies on logout.
<code> add_js( 'document. cookie = "has_js=1; path=/";', 'inline');
/**
* Add the has_js cookie to the user's JS entry
*/
function site_tweaks_init() {
global $user;
if($user->uid > 0) {
drupal_
}
}
/** user($op, &$edit, $account) { 'has_js' , '', time() - 3600);
* Adds a 'has_js' cookie for only logged-in users
*/
function site_tweaks_
if($op == 'logout') {
setcookie(
}
}
</code>