class Illuminate / Cookie / CookieJar
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

CookieJar

Implements

Uses

Properties

protected

$path string

The default path (if specified).

Default: '/'
protected

$domain string|null

The default domain (if specified).

Default: null
protected

$secure bool|null

The default secure setting (defaults to null).

Default: null
protected

$sameSite string

The default SameSite option (defaults to lax).

Default: 'lax'
protected

$queued Symfony\...\Cookie[]

All of the cookies queued for sending.

Default: []

Methods

public

make ( $name , $value , $minutes , $path , $domain , $secure , $httpOnly , $raw , $sameSite ) : Symfony\...\Cookie

Create a new cookie instance.

Parameters

  • $name string
  • $value string
  • $minutes int
  • $path string|null
  • $domain string|null
  • $secure bool|null
  • $httpOnly bool
  • $raw bool
  • $sameSite string|null
public

forever ( $name , $value , $path , $domain , $secure , $httpOnly , $raw , $sameSite ) : Symfony\...\Cookie

Create a cookie that lasts "forever" (400 days).

Parameters

  • $name string
  • $value string
  • $path string|null
  • $domain string|null
  • $secure bool|null
  • $httpOnly bool
  • $raw bool
  • $sameSite string|null
public

forget ( $name , $path , $domain ) : Symfony\...\Cookie

Expire the given cookie.

Parameters

  • $name string
  • $path string|null
  • $domain string|null
public

hasQueued ( $key , $path ) : bool

Determine if a cookie has been queued.

Parameters

  • $key string
  • $path string|null
public

queued ( $key , $default , $path ) : Symfony\...\Cookie|null

Get a queued cookie instance.

Parameters

  • $key string
  • $default mixed
  • $path string|null
public

queue ( $parameters ) : void

Queue a cookie to send with the next response.

Parameters

  • $parameters mixed
public

expire ( $name , $path , $domain ) : void

Queue a cookie to expire with the next response.

Parameters

  • $name string
  • $path string|null
  • $domain string|null
public

unqueue ( $name , $path ) : void

Remove a cookie from the queue.

Parameters

  • $name string
  • $path string|null
protected

getPathAndDomain ( $path , $domain , $secure , $sameSite ) : array

Get the path and domain, or the default values.

Parameters

  • $path string
  • $domain string|null
  • $secure bool|null
  • $sameSite string|null
public

setDefaultPathAndDomain ( $path , $domain , $secure , $sameSite ) : $this

Set the default path and domain for the jar.

Parameters

  • $path string
  • $domain string|null
  • $secure bool|null
  • $sameSite string|null
public

getQueuedCookies ( ) : Symfony\...\Cookie[]

Get the cookies which have been queued for the next request.

public

flushQueuedCookies ( ) : $this

Flush the cookies which have been queued for the next request.