Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cookie_alert

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie_alert

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CookieAlert (beta)

CookieAlert will add an alert to your webpage informing your visitor that your website uses Cookies. It can be configured to display the Alert for a fixed number of views, or display it constantly until the visitor 'accepts' the alert. It:

  • Will work 'straight out the box' without any additional configuration
  • Is fully customisable, including views, javascript response and number of displays.
  • Aims to be a simple way to address the EU Cookie Law requiring websites to notify their visitors that they use Cookies.

Install

  1. Update Gemfile to add

      gem "cookie_alert"
    
  2. Run bundle

    bundle install
    
  3. Install the configuration & view files

    rails g cookie_alert:install
    
  4. Update your app/helpers/application_helper.rb file to include the CookieAlert module:

      include CookieAlert
    
  5. Update your config/routes.rb file to add the CookieAlert route:

      mount CookieAlert::Engine => "/cookie-alert"
    
  6. Update your Asset Manifest files to add the JavaScript and CSS files:

  • in application.js add

    //= require cookie_alert
    
  • in application.css add

    *= require cookie_alert
    

Uninstall

To remove the installed files run rails g cookie_alert:uninstall

Displaying Alerts

To display the Cookie Alerts, simply call the following method from your layout <%= display_cookie_alert %>

How It Works

When a visitor first comes to your site CookieAlert will set an encrypted Cookie that keeps track of how many pages the visitor has viewed and display a Primary Alert notifying the visitor that your site uses Cookies. By default this Primary Alert is a large banner fixed at the foot of the screen.

After the Primary Alert has been displayed a number of times (5 by default) it is replaced by a Secondary Alert. By default this is a smaller box fixed to the bottom-left of the screen which transforms back to the the large banner when moused-over.

The visitor can click a link to 'hide the banner', thereby accepting the notice, and the Alerts will no longer be displayed for the remainder of the session.

Configuration

CookieAlert can be configured to:

  • Display a Primary Alert message until the visitor clicks the 'accept' link.
  • Display a Primary Alert message which, after a number of views, changes to a Secondary Alert message until the visitor clicks the 'accept' link.
  • Display a Primary Alert message then, after a number of views, stop showing any alert messages at all.

Please check the WIKI for a full list of the configuration options available.

JavaScript

The default Alerts use JQuery to allow a server-side response and to add effects. You can easily change this to use a different JavaScript framework (or none at all!). Check the WIKI to see how.

IMPORTANT

If you are using CookieAlert to address the EU Cookie Law, then within the Alert message you should also include a link to a Cookie Policy page where your visitors can view a description of the cookies used by your site. See KatanaCode.com for an example.

Note that CookieAlert is designed to allow you to display alerts - the content and wording of the alert is entirely your own responsibility. KatanaCode do not warrant in any way that the default message, operation or usage of this Gem will make you compliant with the EU Cookie Law. It is up to you to ensure compliance!

All we can say is that we use it ourselves.

Issues

If you discover a problem with CookieAlert, please let us know about it.

Remember to search the issues list first in case your issue has already been raised by another Githuber

Documentation

Full documentation is available here: http://rubydoc.info/gems/cookie_alert

Contributing

You're welcome to contribute to CookieAlert. Please consult the contribution guidelines for more info.

Copyright 2013 Katana Code Ltd.

See MIT-LICENSE for full details.

Credits

Developed by CodeMeister at Katana Code Ltd

About Katana Code

Katana Code are iPhone app and Ruby on Rails Developers in Edinburgh, Scotland.

FAQs

Package last updated on 03 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc