Hi,
I'm populating a hidden field (snid - a userId, stored as 'sn' in the cookie) with data from the user's cookie. Everything seems to be working correctly, yet when I sort Entries by snid, every 15 or 20 entries has a duplicate snid, everything else captured: name, address, email etc., is fine but somehow the cookie-populated field seems to have carried over to another entry.
Here is the code for putting the cookie in the form:
add_filter("gform_field_value_snid", "populate_snid");
function populate_snid() {
if ( isset( $_COOKIE['oatmeal'] ) ) {
$tmp = $_COOKIE['oatmeal'];
$tmp = wp_parse_args( $tmp );
$snid_value = $tmp['sn'];
if ( strlen( $snid_value ) < 1 ){
$snid_value = 'unable to determine snid';
}
} else {
$snid_value = 'no cookie info.';
}
return $snid_value;
}
Thanks