I am trying to hide the fact that I have a Drupal site (as much as possible).

The idea is that if a would be hacker (I am not talking about some ninja that could break into the pentagon) looks at the site they would not be able to (easily) see it is a Drupal site.

Most of it is done - I just don't know how to delete some cookies set by modules. In specific I want to do this for anonymous traffic (clearly someone that is logged in already knows they are on a Drupal site). The cookies that I want to delete would not affect the site - it is related to two admin modules.

I tried a couple of hooks - the last one was theme_html_head_alter - but nothing works. This is the code I need to insert somewhere - just not sure where?

if (!user_is_logged_in()) {
  • Try hook_page_alter(). Apr 5, 2016 at 17:58
  • thanks - tried. no luck. But I think I am being stupid. If a user is anonymouse - they will never access the admin section, so those two cookies will never be set - so there is no need to delete them. Thanks any how. Apr 5, 2016 at 18:05

1 Answer 1


Did not find the answer (I did try hook_page_alter) - but I realised I was not focusing. I want to hide those cookies from anonymous users, but those users will never access the admin section, so the two cookies I am trying to delete, will never be set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.