Getting cookie value passed into hidden field

I am trying to populate a hidden field with the value of 1st party cookie. I see in the documentation that I would use this snippet in the functions.php file to dynamically populate:

add_filter( 'gform_field_value_your_parameter', 'my_custom_population_function' );
function my_custom_population_function( $value ) {
    return 'boom!';

I’m stuck on the return part. What’s the proper way to write that it should return the value of a cookie?

Please see example two there: