Apparently, it's not documented, but Drupal core includes the jQuery.cookie library.
$.cookie('the_cookie', 'the_value'); console.log($.cookie('the_cookie')); // => "the_value"
I used to put this library inside the 'libraries' directory, and then load it via:
<?php drupal_add_js(libraries_get_path('jquery.cookie') . '/jquery.cookie.js', array('group' => JS_LIBRARY));
But I didn't need to do it if I used the one bundled with Drupal:
<?php drupal_add_library('system', 'jquery.cookie');
It's not the first time I manually add something to Drupal that already exists.
To see all available libraries, run drupal_get_library():