Documentation

Mage_Core_Model_Cookie
in package

Table of Contents

Constants

DEFAULT_COOKIE_LIFETIME  : mixed = 60 * 60 * 24 * 365
XML_PATH_COOKIE_DOMAIN  : mixed = 'web/cookie/cookie_domain'
XML_PATH_COOKIE_HTTPONLY  : mixed = 'web/cookie/cookie_httponly'
XML_PATH_COOKIE_LIFETIME  : mixed = 'web/cookie/cookie_lifetime'
XML_PATH_COOKIE_PATH  : mixed = 'web/cookie/cookie_path'
XML_PATH_COOKIE_SAMESITE  : mixed = 'web/cookie/cookie_samesite'

Properties

$_lifetime  : mixed
$_store  : Mage_Core_Model_Store|null
Store object

Methods

delete()  : $this
Delete cookie
get()  : mixed
Retrieve cookie or false if not exists
getConfigDomain()  : string
Retrieve Config Domain for cookie
getDomain()  : string
Retrieve Domain for cookie
getHttponly()  : bool|null
Retrieve use HTTP only flag
getLifetime()  : int
Retrieve cookie lifetime
getPath()  : string
Retrieve Path for cookie
getSameSite()  : string
Retrieve use SameSite
getStore()  : Mage_Core_Model_Store
Retrieve Store object
isSecure()  : bool
Retrieve use secure cookie
renew()  : $this
Postpone cookie expiration time if cookie value defined
set()  : $this
Set cookie
setLifetime()  : $this
Set cookie lifetime
setStore()  : $this
Set Store object
_getRequest()  : Mage_Core_Controller_Request_Http
Retrieve Request object
_getResponse()  : Mage_Core_Controller_Response_Http
Retrieve Response object

Constants

public mixed DEFAULT_COOKIE_LIFETIME = 60 * 60 * 24 * 365
public mixed XML_PATH_COOKIE_DOMAIN = 'web/cookie/cookie_domain'
public mixed XML_PATH_COOKIE_HTTPONLY = 'web/cookie/cookie_httponly'
public mixed XML_PATH_COOKIE_LIFETIME = 'web/cookie/cookie_lifetime'
public mixed XML_PATH_COOKIE_PATH = 'web/cookie/cookie_path'
public mixed XML_PATH_COOKIE_SAMESITE = 'web/cookie/cookie_samesite'

Properties

$_lifetime

protected mixed $_lifetime

Methods

delete()

Delete cookie

public delete(string $name[, string $path = null ][, string $domain = null ][, int|bool $secure = null ][, int|bool $httponly = null ][, string $sameSite = null ]) : $this
Parameters
$name : string
$path : string = null
$domain : string = null
$secure : int|bool = null
$httponly : int|bool = null
$sameSite : string = null
Return values
$this

get()

Retrieve cookie or false if not exists

public get([string $name = null ]) : mixed
Parameters
$name : string = null

The cookie name

getConfigDomain()

Retrieve Config Domain for cookie

public getConfigDomain() : string
Return values
string

getDomain()

Retrieve Domain for cookie

public getDomain() : string
Return values
string

getHttponly()

Retrieve use HTTP only flag

public getHttponly() : bool|null
Return values
bool|null

getLifetime()

Retrieve cookie lifetime

public getLifetime() : int
Return values
int

getPath()

Retrieve Path for cookie

public getPath() : string
Return values
string

getSameSite()

Retrieve use SameSite

public getSameSite() : string
Return values
string

isSecure()

Retrieve use secure cookie

public isSecure() : bool
Return values
bool

renew()

Postpone cookie expiration time if cookie value defined

public renew(string $name[, int $period = null ][, string $path = null ][, string $domain = null ][, int|bool $secure = null ][, bool $httponly = null ][, string $sameSite = null ]) : $this
Parameters
$name : string

The cookie name

$period : int = null

Lifetime period

$path : string = null
$domain : string = null
$secure : int|bool = null
$httponly : bool = null
$sameSite : string = null
Return values
$this

set()

Set cookie

public set(string $name, string $value[, int|bool $period = null ][, string $path = null ][, string $domain = null ][, int|bool $secure = null ][, bool $httponly = null ][, string $sameSite = null ]) : $this
Parameters
$name : string

The cookie name

$value : string

The cookie value

$period : int|bool = null

Lifetime period

$path : string = null
$domain : string = null
$secure : int|bool = null
$httponly : bool = null
$sameSite : string = null
Return values
$this

setLifetime()

Set cookie lifetime

public setLifetime(int $lifetime) : $this
Parameters
$lifetime : int
Return values
$this
On this page

Search results