ri_gfdp_cookie

The Gravity Forms Data Persistence Add-On Reloaded ri gfdp cookie function.

Description

ri_gfdp_cookie(); 

Usage

  1. if ( !function_exists( 'ri_gfdp_cookie' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-data-persistence-add-on-reloaded/gravity-forms-data-persistence-add-on-reloaded.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ri_gfdp_cookie(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/gravity-forms-data-persistence-add-on-reloaded.php  
  1. function ri_gfdp_cookie() { 
  2. if ( isset( $_COOKIE['gfdp'] ) ) { 
  3. setcookie( 'gfdp', $_COOKIE['gfdp'], time()+YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false ); 
  4. } else { 
  5. setcookie( 'gfdp', md5( time()/rand(100, 1000) . $_SERVER['REMOTE_ADDR'] ), time()+YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false );