Cookie Plugin

Back to plugins | Download plugin

The Cookie plugin adds 2 methods to easily read and write to cookies.

Read

To get the value of a cookie all you need is the name.

  var value = nano.cookie.read('example');

Write

The nano.cookie.write() method allows you to create a new cookie or modify an existing value. It these arguments in the following order:

  nano.cookie.write('example', 123, nano.time(nano.time()+(24*60*60*1000), 'UTC'), '/');

You can use the nano.time() function to generate the UTC date string. Here we set the expires date to 1 day in the future. The API documentation for nano.time() can be found here

CodeMessageLineFile
2session_start(): open(/var/cpanel/php/sessions/ea-php82/sess_d16d6d14b031dd2ae85bb6935e977e3b, O_RDWR) failed: No such file or directory (2)67/home2/njsorg/public_html/pagetype/cms.php
2session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php82)67/home2/njsorg/public_html/pagetype/cms.php
8192Creation of dynamic property PageTypeCMS::$html is deprecated43/home2/njsorg/public_html/pagetype/plugins/html/pagetype.plugin.php