Warning: Use of undefined constant MDB_STRIPE_SUB_WEBHOOK_SECRET - assumed 'MDB_STRIPE_SUB_WEBHOOK_SECRET' (this will throw an Error in a future version of PHP) in /var/www/tst02/wp-content/themes/mdbootstrap4/inc/mdb-subscriptions/mdb-payments/stripe/class-mdb-stripe-webhook.php on line 26

Warning: Use of undefined constant MDB_PAYPAL_WEBHOOK_ID - assumed 'MDB_PAYPAL_WEBHOOK_ID' (this will throw an Error in a future version of PHP) in /var/www/tst02/wp-content/themes/mdbootstrap4/inc/mdb-subscriptions/mdb-payments/paypal/class-mdb-paypal-webhook.php on line 23

Notice: Undefined index: HTTP_REFERER in /var/www/tst02/wp-content/themes/mdbootstrap4/inc/cookie-setter.php on line 8
Bootstrap Cookies management - examples & tutorial

Cookies management MDB Pro component

Bootstrap 5 Cookies management plugin

This component is used to save in the browser data that we want to have access at the next user visit. For example how many times or when last time user visit our page.

Note: Read the API tab to find all available options and advanced customization


Basic example

The Cookies Management Component provides methods to add, remove and get cookies


Advanced example

Show Modal for new users

Using the showModalNewUser method you can display the modal for new users. Click start button to start simulate this behavior. After next click modal don't show any more until you click reset.

Show modal after next visit

If you want to display the modal to the person who will visit the page again, you can use the showModalScoring method. Enter as a parameter the information after how many visits to the website the modal should appear. Click start button 3 times to test this feature.

Cookies management - API


Usage

Via JavaScript


        Cookie.set('cookie-name', value, {expires: 1});
      

Methods

Name Description Example
set Set Cookie Cookie.set( ... );
get Get Cookie Cookie.get( ... );
set Remove Cookie Cookie.remove( ... );

        Cookie.set('cookie-name', value, {expires: 1});
      

Import

MDB UI KIT also works with module bundlers. Use the following code to import this component:


        import { Cookie } from 'mdb-ui-kit';