CookieAuth
in package
implements
HttpAuthInterface
Tags
Interfaces, Classes and Traits
- HttpAuthInterface
- Interface HttpAuthInterface
Table of Contents
- $authKey : string
- 加解密默认key
- __construct() : mixed
- get() : bool|string
- 从已加密的cookie中取出值
- set() : bool
- 生成加密cookie
- getEncryptKey() : string
- 生成密钥
Properties
$authKey
加解密默认key
private
string
$authKey
= '!wl<@>c(r#%o*s&s'
Methods
__construct()
public
__construct([string $authKey = '' ]) : mixed
Parameters
- $authKey : string = ''
Return values
mixed —get()
从已加密的cookie中取出值
public
get(string $params[, bool $deCode = false ]) : bool|string
Parameters
- $params : string
-
cookie的key
- $deCode : bool = false
Return values
bool|string —set()
生成加密cookie
public
set(string $name, string|array<string|int, mixed> $params, int $expire) : bool
Parameters
- $name : string
- $params : string|array<string|int, mixed>
- $expire : int
Return values
bool —getEncryptKey()
生成密钥
protected
getEncryptKey(string $cookieName) : string
Parameters
- $cookieName : string