本文整理匯總了PHP中Illuminate\Cookie\CookieJar::make方法的典型用法代碼示例。如果您正苦於以下問題:PHP CookieJar::make方法的具體用法?PHP CookieJar::make怎麽用?PHP CookieJar::make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Cookie\CookieJar
的用法示例。
在下文中一共展示了CookieJar::make方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setCookie
/**
* Set the cookies
*
* @return $this
*/
protected function setCookie($remember_me = false)
{
if (config('laravel-avp.cookie_age') == 'forever') {
// Set a forever cookie saying the user is old enough
$cookie = $this->cookie->forever(config('laravel-avp.cookie_name'), config('laravel-avp.cookie_val'));
} elseif ($remember_me) {
// Remember for 30 days
$cookie = $this->cookie->make(config('laravel-avp.cookie_name'), config('laravel-avp.cookie_val'), 60 * 24 * 30);
} elseif (is_int(config('laravel-avp.cookie_age'))) {
// Sets a cookie lasting X minutes saying the user is old enough
$cookie = $this->cookie->make(config('laravel-avp.cookie_name'), config('laravel-avp.cookie_val'), config('laravel-avp.cookie_age'));
} else {
// Sets a session cookie saying the user is old enough
$cookie = $this->cookie->make(config('laravel-avp.cookie_name'), config('laravel-avp.cookie_val'));
}
return redirect()->intended('/')->withCookie($cookie);
}
示例2: make
/**
* 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
* @static
*/
public static function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
return \Illuminate\Cookie\CookieJar::make($name, $value, $minutes, $path, $domain, $secure, $httpOnly);
}
示例3: put
/**
* Put a value in the Sentry cookie.
*
* @param mixed $value
* @param int $minutes
* @return void
*/
public function put($value, $minutes)
{
$cookie = $this->jar->make($this->getKey(), $value, $minutes);
$this->jar->queue($cookie);
}
示例4: getCookie
/**
* Write the session cookie to the response.
*
* @param Illuminate\Cookie\CookieJar $cookie
* @param string $name
* @param int $lifetime
* @return void
*/
public function getCookie(CookieJar $cookie, $name, $lifetime)
{
return $cookie->make($name, $this->getSessionId(), $lifetime);
}
示例5: write
/**
* {@inheritDoc}
*/
public function write($sessionId, $data)
{
$this->setCookie($this->cookie->make($sessionId, $data, $this->minutes));
}