src/Concerns/InteractsWithCookies.php
public function addCookie($name, $value, $expiry = null, array $options = [], $encrypt = true)
    {
        if ($encrypt) {
            $value = encrypt($value, $serialize = false);
        }

        if ($expiry instanceof DateTimeInterface) {
            $expiry = $expiry->getTimestamp();
        }

        $this->driver->manage()->addCookie(
            array_merge($options, compact('expiry', 'name', 'value'))
        );

        return $this;
    }
public function addCookie($name, $value, $expiry = null, array $options = [], $encrypt = true)
    {
        if ($encrypt) {
            $value = encrypt($value, $serialize = false);
        }

        if ($expiry instanceof DateTimeInterface) {
            $expiry = $expiry->getTimestamp();
        }

        $this->driver->manage()->addCookie(
            array_merge($options, compact('expiry', 'name', 'value'))
        );

        return $this;
    }
public function addCookie ( $ name , $ value , $ expiry = null , array $ options = [ ] , $ encrypt = true ) { if ( $ encrypt ) { $ value = encrypt ( $ value , $ serialize = false ) ; } if ( $ expiry instanceof DateTimeInterface ) { $ expiry = $ expiry -> getTimestamp ( ) ; } $ this -> driver -> manage ( ) -> addCookie ( array_merge ( $ options , compact ( 'expiry' , 'name' , 'value' ) ) ) ; return $ this ; }
Add the given cookie.

@param  string  $name
@param  string  $value
@param  int|DateTimeInterface|null  $expiry
@param  array  $options
@param  bool  $encrypt
@return $this
Add the given cookie .