src/Http/CookieFactory.php
public function make($name, $value = null, $maxAge = null)
    {
        $cookie = SetCookie::create($this->getName($name), $value);

        // Make sure we send both the MaxAge and Expires parameters (the former
        // is not supported by all browser versions)
        if ($maxAge) {
            $cookie = $cookie
                ->withMaxAge($maxAge)
                ->withExpires(time() + $maxAge);
        }

        if ($this->domain != null) {
            $cookie = $cookie->withDomain($this->domain);
        }

        return $cookie
            ->withPath($this->path)
            ->withSecure($this->secure)
            ->withHttpOnly(true);
    }
public function make($name, $value = null, $maxAge = null)
    {
        $cookie = SetCookie::create($this->getName($name), $value);

        // Make sure we send both the MaxAge and Expires parameters (the former
        // is not supported by all browser versions)
        if ($maxAge) {
            $cookie = $cookie
                ->withMaxAge($maxAge)
                ->withExpires(time() + $maxAge);
        }

        if ($this->domain != null) {
            $cookie = $cookie->withDomain($this->domain);
        }

        return $cookie
            ->withPath($this->path)
            ->withSecure($this->secure)
            ->withHttpOnly(true);
    }
public function make ( $ name , $ value = null , $ maxAge = null ) { $ cookie = SetCookie :: create ( $ this -> getName ( $ name ) , $ value ) ; // Make sure we send both the MaxAge and Expires parameters (the former // is not supported by all browser versions) if ( $ maxAge ) { $ cookie = $ cookie -> withMaxAge ( $ maxAge ) -> withExpires ( time ( ) + $ maxAge ) ; } if ( $ this -> domain != null ) { $ cookie = $ cookie -> withDomain ( $ this -> domain ) ; } return $ cookie -> withPath ( $ this -> path ) -> withSecure ( $ this -> secure ) -> withHttpOnly ( true ) ; }
Make a new cookie instance.

This method returns a cookie instance for use with the Set-Cookie HTTP header.
It will be pre-configured according to Flarum's base URL and protocol.

@param  string  $name
@param  string  $value
@param  int     $maxAge
@return \Dflydev\FigCookies\SetCookie
Make a new cookie instance .