Whether to hide the cookie from JavaScript

w禁用js访问特定cookie。

https://codeigniter.com/userguide3/helpers/cookie_helper.html

$this->load->helper('cookie');

Available Functions

The following functions are available:

Parameters:
  • $name (mixed) – Cookie name or associative array of all of the parameters available to this function
  • $value (string) – Cookie value
  • $expire (int) – Number of seconds until expiration
  • $domain (string) – Cookie domain (usually: .yourdomain.com)
  • $path (string) – Cookie path
  • $prefix (string) – Cookie name prefix
  • $secure (bool) – Whether to only send the cookie through HTTPS
  • $httponly (bool) – Whether to hide the cookie from JavaScript
Return type:

void

原文地址:https://www.cnblogs.com/rsapaper/p/6370761.html