<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Aceita_cookie_ajax extends CI_Controller {

	function __construct()
	{
		  parent::__construct();
	}
	
	public function aceitarCookie()
	{
	    $this->load->helper('cookie');
	    
	    $nome_pagina = $this->input->post('name');
	    $keyCookie = convertAccentsAndSpecialToNormal(strtolower($nome_pagina));
	    
        set_cookie($keyCookie,'aceito',time() + (10 * 365 * 24 * 60 * 60));
        
        echo json_encode(['valid'=> true]);
	}
}