The Content Cookie Lock module restricts certain roles from accessing content on your site. Several reliable content access modules already exist, but this module serves a different purpose.

We had a need to restrict access to content by using a cookie. We wanted to show content to users who subscribe to a newsletter.

The cookie is encrypted using a value and a secret key, both the value and the secret key need to be specified on the settings page.

If you don't have a good reason to restrict access per content node using encrypted cookie, then you should pick another module like content access or ACL from this list: https://www.drupal.org/node/270000.

The cookie is created upon submitting a webform which is exposed as a block. The webform is set to 'reload current page'. You can find the setting under the Form settings when creating a webform. This ensures the user will see the content immediately without getting redirected when they submit the form.

The module is light, has its own schema for locking content, and doesn't rely on other modules.

Features

  • Optionally display a signup form using the webform module
  • Optionally display a custom message on locked pages
  • Both the signup form and the custom message can be set to be visible/hidden in the content manage display settings

Required modules

If you are going to display a signup form on locked content, then you require the following modules:

Refer to the read-me file for how to configure and use this module.

Project information

Releases