本文整理汇总了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));
}