namespace Illuminate\Cookie;

use Illuminate\Support\Arr;
use Symfony\Component\HttpFoundation\Cookie;
use Illuminate\Contracts\Cookie\QueueingFactory as JarContract;
// namespace about the c
class CookieJar implements JarContract
{// a Cookie Jar can be implements JarContract
/**
* The default path (if specified).
*
* @var string
*/
protected $path = '/';// set the default

/**
* The default domain (if specified).
*
* @var string
*/
protected $domain = null;// set default domain

/**
* The default secure setting (defaults to false).
*
* @var bool
*/
protected $secure = false;// default secure setting is null ,too bad

/**
* All of the cookies queued for sending.
*
* @var array
*/
protected $queued = [];// All of the cookies queued for sending.
// queued for sending

/**
* Create a new cookie instance.
*
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $httpOnly
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
list($path, $domain, $secure) = $this->getPathAndDomain($path, $domain, $secure);// a way to get list

$time = ($minutes == 0) ? 0 : time() + ($minutes * 60);// has times set

return new Cookie($name, $value, $time, $path, $domain, $secure, $httpOnly);// it is a Cookie
// $name is key
// $value is value
// $time set the times
// $path set path
// $domain domain set
// $secure secure set
// $httpOnly httpOnly
}// create or make the instance

/**
* Create a cookie that lasts "forever" (five years).
*
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $httpOnly
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
return $this->make($name, $value, 2628000, $path, $domain, $secure, $httpOnly);
}//Create a cookie that lasts "forever"
// make is let set , throw set time to like to set the long time

/**
* Expire the given cookie.
*
* @param string $name
* @param string $path
* @param string $domain
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forget($name, $path = null, $domain = null)
{
return $this->make($name, null, -2628000, $path, $domain);
}// set a bad time to forget it like delete

/**
* Determine if a cookie has been queued.
*
* @param string $key
* @return bool
*/
public function hasQueued($key)
{
return ! is_null($this->queued($key));
}// if in this queued