cookie::set($key, $value, $expires = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)

Set a new cookie

  • $key (string)
    The name of the cookie
  • $value (string)
    The cookie content
  • $expires (int)
    The number of minutes until the cookie expires
  • $path (string)
    The path on the server to set the cookie for
  • $domain (string)
    the domain
  • $secure (boolean)
    only sets the cookie over https
  • $httpOnly (boolean)
    Sets a cookie only for regular HTTP requests. JavaScript will not be able to access the cookie.
  • return (boolean)
    true: the cookie has been created, false: cookie creation failed