PHP Класс Gdn_CookieIdentity, vanilla

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$CookieDomain string
$CookieHashMethod boolean
$CookieName string
$CookiePath string
$CookieSalt string
$PersistExpiry string
$SessionExpiry string
$UserID integer | null
$VolatileMarker string

Открытые методы

Метод Описание
__construct ( null $Config = null )
checkCookie ( $CookieName, null $CookieHashMethod = null, null $CookieSalt = null ) : boolean Validate security of our cookie.
checkVolatileMarker ( $CheckUserID ) : boolean
deleteCookie ( $CookieName, null $Path = null, null $Domain = null ) Remove a cookie.
getCookiePayload ( string $CookieName ) : array Get the pieces that make up our cookie data.
getIdentity ( ) : integer Returns the unique id assigned to the user in the database (retrieved from the session cookie if the cookie authenticates) or FALSE if not found or authentication fails.
hasVolatileMarker ( $CheckUserID ) : boolean
init ( null $Config = null )
setCookie ( string $CookieName, string $KeyData, mixed $CookieContents, integer $CookieExpires, string $Path = null, string $Domain = null, string $CookieHashMethod = null, string $CookieSalt = null ) : void Set a cookie, using specified path, domain, salt and hash method
setIdentity ( integer $UserID, boolean $Persist = false ) Generates the user's session cookie.
setVolatileMarker ( integer $UserID ) : void

Защищенные методы

Метод Описание
_checkCookie ( $CookieName ) : boolean
_clearIdentity ( ) Destroys the user's session cookie - essentially de-authenticating them.
_deleteCookie ( $CookieName ) Remove a cookie.
_setCookie ( string $CookieName, string $KeyData, mixed $CookieContents, integer $CookieExpires ) : void Set a cookie, using path, domain, salt, and hash method from core config

Описание методов

__construct() публичный Метод

public __construct ( null $Config = null )
$Config null

_checkCookie() защищенный Метод

protected _checkCookie ( $CookieName ) : boolean
$CookieName
Результат boolean

_clearIdentity() защищенный Метод

Destroys the user's session cookie - essentially de-authenticating them.
protected _clearIdentity ( )

_deleteCookie() защищенный Метод

Remove a cookie.
protected _deleteCookie ( $CookieName )
$CookieName

_setCookie() защищенный Метод

Set a cookie, using path, domain, salt, and hash method from core config
protected _setCookie ( string $CookieName, string $KeyData, mixed $CookieContents, integer $CookieExpires ) : void
$CookieName string Name of the cookie
$KeyData string
$CookieContents mixed
$CookieExpires integer
Результат void

checkCookie() публичный статический Метод

Validate security of our cookie.
public static checkCookie ( $CookieName, null $CookieHashMethod = null, null $CookieSalt = null ) : boolean
$CookieName
$CookieHashMethod null
$CookieSalt null
Результат boolean

checkVolatileMarker() публичный Метод

public checkVolatileMarker ( $CheckUserID ) : boolean
$CheckUserID
Результат boolean

deleteCookie() публичный статический Метод

Remove a cookie.
public static deleteCookie ( $CookieName, null $Path = null, null $Domain = null )
$CookieName
$Path null
$Domain null

getCookiePayload() публичный статический Метод

Get the pieces that make up our cookie data.
public static getCookiePayload ( string $CookieName ) : array
$CookieName string
Результат array

getIdentity() публичный Метод

Returns the unique id assigned to the user in the database (retrieved from the session cookie if the cookie authenticates) or FALSE if not found or authentication fails.
public getIdentity ( ) : integer
Результат integer

hasVolatileMarker() публичный Метод

public hasVolatileMarker ( $CheckUserID ) : boolean
$CheckUserID
Результат boolean

init() публичный Метод

public init ( null $Config = null )
$Config null

setCookie() публичный статический Метод

Set a cookie, using specified path, domain, salt and hash method
public static setCookie ( string $CookieName, string $KeyData, mixed $CookieContents, integer $CookieExpires, string $Path = null, string $Domain = null, string $CookieHashMethod = null, string $CookieSalt = null ) : void
$CookieName string Name of the cookie
$KeyData string
$CookieContents mixed
$CookieExpires integer
$Path string Optional. Cookie path (auto load from config)
$Domain string Optional. Cookie domain (auto load from config)
$CookieHashMethod string Optional. Cookie hash method (auto load from config)
$CookieSalt string Optional. Cookie salt (auto load from config)
Результат void

setIdentity() публичный Метод

Generates the user's session cookie.
public setIdentity ( integer $UserID, boolean $Persist = false )
$UserID integer The unique id assigned to the user in the database.
$Persist boolean Should the user's session remain persistent across visits?

setVolatileMarker() публичный Метод

public setVolatileMarker ( integer $UserID ) : void
$UserID integer
Результат void

Описание свойств

$CookieDomain публичное свойство

public string $CookieDomain
Результат string

$CookieHashMethod публичное свойство

public bool $CookieHashMethod
Результат boolean

$CookieName публичное свойство

public string $CookieName
Результат string

$CookiePath публичное свойство

public string $CookiePath
Результат string

$CookieSalt публичное свойство

public string $CookieSalt
Результат string

$PersistExpiry публичное свойство

public string $PersistExpiry
Результат string

$SessionExpiry публичное свойство

public string $SessionExpiry
Результат string

$UserID публичное свойство

public int|null $UserID
Результат integer | null

$VolatileMarker публичное свойство

public string $VolatileMarker
Результат string