I wnat to set cookie with a name csrf_cookie_name with a value from this function $this->security->get_csrf_hash(); but, it is not working.
The cookie is already there. You can consult via Javascript with:
$.cookie("config->item("csrf_cookie_name"); ?>");
I hope be useful.