class Cookie (View source)

Properties

protected $name
protected $value
protected $domain
protected $expire
protected $path
protected $secure
protected $httpOnly
protected $sameSite

Methods

__construct(string $name, string $value = null, int|string|DateTime $expire = 0, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, $sameSite = 'lax')

Konstruktor.

string
__toString()

Mereturn object cookie sebagai string.

string
getName()

Ambil nama cookie.

string
getValue()

Ambil value cookie.

string
getDomain()

Ambil domain cookie.

int
getExpiresTime()

Ambil waktu kedaluwarsa cookie.

string
getPath()

Ambil path cookie di server.

bool
isSecure()

Cek apakah cookie hanya boleh dikirimkan via HTTPS saja.

bool
isHttpOnly()

Cek apakah cookie hanya boleh tersedia via HTTP saja.

bool
isCleared()

Cek apakah cookie sudah waktunya untuk dibersihkan.

string
getSameSite()

Ambil atribut samesite cookie.

Details

__construct(string $name, string $value = null, int|string|DateTime $expire = 0, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, $sameSite = 'lax')

Konstruktor.

Parameters

string $name
string $value
int|string|DateTime $expire
string $path
string $domain
bool $secure
bool $httpOnly
$sameSite

string __toString()

Mereturn object cookie sebagai string.

Return Value

string

string getName()

Ambil nama cookie.

Return Value

string

string getValue()

Ambil value cookie.

Return Value

string

string getDomain()

Ambil domain cookie.

Return Value

string

int getExpiresTime()

Ambil waktu kedaluwarsa cookie.

Return Value

int

string getPath()

Ambil path cookie di server.

Return Value

string

bool isSecure()

Cek apakah cookie hanya boleh dikirimkan via HTTPS saja.

Return Value

bool

bool isHttpOnly()

Cek apakah cookie hanya boleh tersedia via HTTP saja.

Return Value

bool

bool isCleared()

Cek apakah cookie sudah waktunya untuk dibersihkan.

Return Value

bool

string getSameSite()

Ambil atribut samesite cookie.

Return Value

string