\DtApp\ThinkLibrary\sessionMysql

Session保存在MySQL驱动 Class Mysql

Summary

Methods
Properties
Constants
read()
delete()
write()
No public properties found
No constants found
No protected methods found
$table_name
$config
N/A
No private methods found
No private properties found
N/A

Properties

$table_name

$table_name : string

表名

Type

string

$config

$config : array

session_expire Session有效期 单位:秒 session_prefix Session前缀

Type

array

Methods

read()

read(string  $sessionId) : string

read方法是在调用Session::start()的时候执行,并且只会执行一次。

Parameters

string $sessionId

Returns

string

delete()

delete(string  $sessionId) : boolean

delete方法是在销毁会话的时候执行(调用Session::destroy()方法)。

Parameters

string $sessionId

Throws

\think\db\exception\DbException

Returns

boolean

write()

write(string  $sessionId, string  $data) : boolean

write方法是在本地化会话数据的时候执行(调用Session::save()方法),系统会在每次请求结束的时候自动执行。

Parameters

string $sessionId
string $data

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\DbException
\think\db\exception\ModelNotFoundException

Returns

boolean