Как насчет использования плагина Cookie для jQuery?
$.cookie('the_cookie', 'the_value'); // Create a session cookie ("the_cookie") and set its value to "the_value"
$.cookie('chocolate_chip_cookie', 'the_value', { // create a cookie with all available options
expires: 7, // expires in seven days
path: '/', // accessible from the whole site...
domain: 'jquery.com',
secure: true // ...but only on a secure connection
});
$.cookie('the_cookie', null); // delete the session cookie